diff --git a/lib/libcurses/copywin.c b/lib/libcurses/copywin.c index 0bec7224f..6db2b3bb8 100644 --- a/lib/libcurses/copywin.c +++ b/lib/libcurses/copywin.c @@ -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; diff --git a/usr.sbin/mtree/spec.c b/usr.sbin/mtree/spec.c index 1dcedb434..62eaa0d57 100644 --- a/usr.sbin/mtree/spec.c +++ b/usr.sbin/mtree/spec.c @@ -454,7 +454,8 @@ parsedev(char *arg) if (*ep != '\0') mtree_err("invalid number `%s'", p); - if (argc > MAX_PACK_ARGS) + /* MINIX: 03 warns for above array bounds*/ + if (argc >= MAX_PACK_ARGS) mtree_err("too many arguments"); } if (argc < 2)