diff --git a/src/asm/fstack.c b/src/asm/fstack.c index 199a2ed1..e6ec6bce 100644 --- a/src/asm/fstack.c +++ b/src/asm/fstack.c @@ -225,12 +225,8 @@ void fstk_AddIncludePath(char *s) if (NextIncPath == MAXINCPATHS) fatalerror("Too many include directories passed from command line"); - if (strlen(s) >= sizeof(IncludePaths[0])) + if (snprintf(IncludePaths[NextIncPath++], _MAX_PATH, "%s", s) >= _MAX_PATH) fatalerror("Include path too long '%s'", s); - - strncpy(IncludePaths[NextIncPath], s, sizeof(IncludePaths[0])); - - NextIncPath++; } FILE *fstk_FindFile(char *fname)