Remove dependency of strlcpy()

There was only one place where `strlcpy` was still used.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2018-01-27 00:02:44 +00:00
parent f9f3bb7761
commit c6187be210
5 changed files with 5 additions and 81 deletions

View File

@@ -24,7 +24,6 @@
#include "asm/symbol.h"
#include "extern/err.h"
#include "extern/strl.h"
#include "types.h"
@@ -226,8 +225,12 @@ void fstk_AddIncludePath(char *s)
if (NextIncPath == MAXINCPATHS)
fatalerror("Too many include directories passed from command line");
if (strlcpy(IncludePaths[NextIncPath++], s, _MAX_PATH) >= _MAX_PATH)
if (strlen(s) >= sizeof(IncludePaths[0]))
fatalerror("Include path too long '%s'", s);
strncpy(IncludePaths[NextIncPath], s, sizeof(IncludePaths[0]));
NextIncPath++;
}
FILE *fstk_FindFile(char *fname)