From 2e6e43c4a706e3670f131c7b2d5a5525f9bf0d7b Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 29 Mar 2014 21:25:55 -0400 Subject: heretic: Eliminate use of unsafe string functions. Eliminate use of strcpy, strcat, strncpy, and use the new safe alternatives. --- src/hexen/h2_main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/hexen/h2_main.c') diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c index 0afdff24..845496b4 100644 --- a/src/hexen/h2_main.c +++ b/src/hexen/h2_main.c @@ -551,12 +551,11 @@ static void HandleArgs(void) { char file[256]; - strncpy(file, myargv[p+1], sizeof(file)); - file[sizeof(file) - 6] = '\0'; + M_StringCopy(file, myargv[p+1], sizeof(file)); - if (strcasecmp(file + strlen(file) - 4, ".lmp") != 0) + if (!M_StringEndsWith(file, ".lmp")) { - strcat(file, ".lmp"); + M_StringConcat(file, ".lmp", sizeof(file)); } W_AddFile(file); -- cgit v1.2.3