4 ms·
1) In main.c the vals array is statically sized at 256 entries, but entries are put into it mod terminal width, with no guarantee that the terminal is <= 256 ch
by elbee 14y ago
1) In main.c the vals array is statically sized at 256 entries, but entries are put into it mod terminal width, with no guarantee that the terminal is <= 256 characters wide. That will lead to a buffer overflow.
2) INT_MIN cannot be negated -- you should check for that and just use INT_MAX instead.