diff options
author | Simon Howard | 2014-03-29 20:37:11 -0400 |
---|---|---|
committer | Simon Howard | 2014-03-29 20:37:11 -0400 |
commit | e63a8d5e3b2ebc848e01c139756cd2096efe7c80 (patch) | |
tree | 14a1acba93dc2832dbbbcd267ec83af41adb818b /src/doom/d_main.c | |
parent | 62b5c602821cee8ac703ebe6362f3e1fc6d9ad3c (diff) | |
download | chocolate-doom-e63a8d5e3b2ebc848e01c139756cd2096efe7c80.tar.gz chocolate-doom-e63a8d5e3b2ebc848e01c139756cd2096efe7c80.tar.bz2 chocolate-doom-e63a8d5e3b2ebc848e01c139756cd2096efe7c80.zip |
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.
Diffstat (limited to 'src/doom/d_main.c')
-rw-r--r-- | src/doom/d_main.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 { |