summaryrefslogtreecommitdiff
path: root/src/hexen/p_acs.c
diff options
context:
space:
mode:
authorSimon Howard2014-03-30 19:00:49 -0400
committerSimon Howard2014-03-30 19:00:49 -0400
commit01ae851bf998330a9ca95467e238c507aa55cae1 (patch)
tree3fe17da2cdd49ea725c7a6d044ca4885ce024401 /src/hexen/p_acs.c
parent6bb5f78bd2bdf10ddbb087171c6f640d425c9d40 (diff)
downloadchocolate-doom-01ae851bf998330a9ca95467e238c507aa55cae1.tar.gz
chocolate-doom-01ae851bf998330a9ca95467e238c507aa55cae1.tar.bz2
chocolate-doom-01ae851bf998330a9ca95467e238c507aa55cae1.zip
hexen: Eliminate use of sprintf().
Use snprintf() in place of sprintf(). This is part of fixing #371.
Diffstat (limited to 'src/hexen/p_acs.c')
-rw-r--r--src/hexen/p_acs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/hexen/p_acs.c b/src/hexen/p_acs.c
index 27b07682..a9e64517 100644
--- a/src/hexen/p_acs.c
+++ b/src/hexen/p_acs.c
@@ -443,7 +443,8 @@ boolean P_StartACS(int number, int map, byte * args, mobj_t * activator,
if (infoIndex == -1)
{ // Script not found
//I_Error("P_StartACS: Unknown script number %d", number);
- sprintf(ErrorMsg, "P_STARTACS ERROR: UNKNOWN SCRIPT %d", number);
+ snprintf(ErrorMsg, sizeof(ErrorMsg),
+ "P_STARTACS ERROR: UNKNOWN SCRIPT %d", number);
P_SetMessage(&players[consoleplayer], ErrorMsg, true);
}
statePtr = &ACSInfo[infoIndex].state;
@@ -539,8 +540,8 @@ boolean P_StartLockedACS(line_t * line, byte * args, mobj_t * mo, int side)
{
if (!(mo->player->keys & (1 << (lock - 1))))
{
- sprintf(LockedBuffer, "YOU NEED THE %s\n",
- TextKeyMessages[lock - 1]);
+ snprintf(LockedBuffer, sizeof(LockedBuffer),
+ "YOU NEED THE %s\n", TextKeyMessages[lock - 1]);
P_SetMessage(mo->player, LockedBuffer, true);
S_StartSound(mo, SFX_DOOR_LOCKED);
return false;