From e63a8d5e3b2ebc848e01c139756cd2096efe7c80 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 29 Mar 2014 20:37:11 -0400 Subject: misc: Add M_StringConcat. Just as M_StringCopy behaves the same as strlcpy(), M_StringConcat behaves the same as strlcat(). Use this in one location. --- src/doom/d_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/doom/d_main.c') diff --git a/src/doom/d_main.c b/src/doom/d_main.c index fa84bc3b..60d93696 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -1002,10 +1002,11 @@ static void LoadChexDeh(void) if (sep != NULL) { - chex_deh = malloc(strlen(iwadfile) + 9); - strcpy(chex_deh, iwadfile); + size_t chex_deh_len = strlen(iwadfile) + 9; + chex_deh = malloc(chex_deh_len); + M_StringCopy(chex_deh, iwadfile, chex_deh_len); chex_deh[sep - iwadfile + 1] = '\0'; - strcat(chex_deh, "chex.deh"); + M_StringConcat(chex_deh, "chex.deh", chex_deh_len); } else { -- cgit v1.2.3