diff options
-rw-r--r-- | com32/lib/sys/module/common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c index 30c57b4b..dfbdf617 100644 --- a/com32/lib/sys/module/common.c +++ b/com32/lib/sys/module/common.c @@ -71,7 +71,7 @@ FILE *findpath(char *name) p = PATH; again: i = 0; - while (*p && *p != ':' && i < FILENAME_MAX) { + while (*p && *p != ':' && i < FILENAME_MAX - 1) { path[i++] = *p++; } @@ -79,7 +79,7 @@ again: p++; n = name; - while (*n && i < FILENAME_MAX) + while (*n && i < FILENAME_MAX - 1) path[i++] = *n++; path[i] = '\0'; |