Fix out of array bounds errors with -O3
When compiling with -O3 gcc seems to be a lot stricter on its checks for index out of bounds error. Change-Id: I5a63e1db6aa2375223ff13c6352643a9804fa93d
This commit is contained in:
@@ -118,7 +118,8 @@ int copywin(const WINDOW *srcwin, WINDOW *dstwin,
|
||||
cc.elements = 1;
|
||||
np = sp->nsp;
|
||||
if (np) {
|
||||
while (np && cc.elements <=
|
||||
/* MINIX: off-by one error, has to be strictly less than. */
|
||||
while (np && cc.elements <
|
||||
CURSES_CCHAR_MAX) {
|
||||
cc.vals[cc.elements++] = np->ch;
|
||||
np = np->next;
|
||||
|
||||
Reference in New Issue
Block a user