summaryrefslogtreecommitdiff
path: root/src/hexen/h2_main.c
diff options
context:
space:
mode:
authorSimon Howard2014-03-29 21:25:55 -0400
committerSimon Howard2014-03-29 21:25:55 -0400
commit2e6e43c4a706e3670f131c7b2d5a5525f9bf0d7b (patch)
tree5779e2bb137ce8771b1c12f1f3fd234d16d997f6 /src/hexen/h2_main.c
parent5f9b4368a2adad65dcc960a76c45d12059ca7214 (diff)
downloadchocolate-doom-2e6e43c4a706e3670f131c7b2d5a5525f9bf0d7b.tar.gz
chocolate-doom-2e6e43c4a706e3670f131c7b2d5a5525f9bf0d7b.tar.bz2
chocolate-doom-2e6e43c4a706e3670f131c7b2d5a5525f9bf0d7b.zip
heretic: Eliminate use of unsafe string functions.
Eliminate use of strcpy, strcat, strncpy, and use the new safe alternatives.
Diffstat (limited to 'src/hexen/h2_main.c')
-rw-r--r--src/hexen/h2_main.c7
1 files changed, 3 insertions, 4 deletions
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);