diff options
author | Simon Howard | 2014-03-29 21:25:55 -0400 |
---|---|---|
committer | Simon Howard | 2014-03-29 21:25:55 -0400 |
commit | 2e6e43c4a706e3670f131c7b2d5a5525f9bf0d7b (patch) | |
tree | 5779e2bb137ce8771b1c12f1f3fd234d16d997f6 /src/hexen/p_acs.c | |
parent | 5f9b4368a2adad65dcc960a76c45d12059ca7214 (diff) | |
download | chocolate-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/p_acs.c')
-rw-r--r-- | src/hexen/p_acs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/hexen/p_acs.c b/src/hexen/p_acs.c index 9ca9f6af..27b07682 100644 --- a/src/hexen/p_acs.c +++ b/src/hexen/p_acs.c @@ -26,6 +26,7 @@ // HEADER FILES ------------------------------------------------------------ #include "h2def.h" +#include "m_misc.h" #include "m_random.h" #include "s_sound.h" #include "i_swap.h" @@ -1682,7 +1683,7 @@ static int CmdEndPrintBold(void) static int CmdPrintString(void) { - strcat(PrintBuffer, ACStrings[Pop()]); + M_StringConcat(PrintBuffer, ACStrings[Pop()], sizeof(PrintBuffer)); return SCRIPT_CONTINUE; } @@ -1690,8 +1691,8 @@ static int CmdPrintNumber(void) { char tempStr[16]; - sprintf(tempStr, "%d", Pop()); - strcat(PrintBuffer, tempStr); + snprintf(tempStr, sizeof(tempStr), "%d", Pop()); + M_StringConcat(PrintBuffer, tempStr, sizeof(PrintBuffer)); return SCRIPT_CONTINUE; } |