summaryrefslogtreecommitdiff
path: root/src/strife
diff options
context:
space:
mode:
authorJames Haley2012-04-02 03:21:45 +0000
committerJames Haley2012-04-02 03:21:45 +0000
commit1e7908feb322f4ad8a88008964f1558861348ae6 (patch)
tree0d442e95e842f32abf7005926c4f48a2e3ff9319 /src/strife
parent81f8ac6c5718ac37dcc713a6e092493190c1998b (diff)
downloadchocolate-doom-1e7908feb322f4ad8a88008964f1558861348ae6.tar.gz
chocolate-doom-1e7908feb322f4ad8a88008964f1558861348ae6.tar.bz2
chocolate-doom-1e7908feb322f4ad8a88008964f1558861348ae6.zip
Fix to undefined sprintf behavior in the dialog engine (thanks to
MP2E!). Other changes are to comments only. Subversion-branch: /branches/v2-branch Subversion-revision: 2509
Diffstat (limited to 'src/strife')
-rw-r--r--src/strife/p_dialog.c5
-rw-r--r--src/strife/p_inter.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/strife/p_dialog.c b/src/strife/p_dialog.c
index 0fa31854..ecb11d25 100644
--- a/src/strife/p_dialog.c
+++ b/src/strife/p_dialog.c
@@ -1057,6 +1057,7 @@ static void P_DialogDrawer(void)
int height;
int finaly;
char choicetext[64];
+ char choicetext2[64];
// Run down bonuscount faster than usual so that flashes from being given
// items are less obvious.
@@ -1130,9 +1131,11 @@ static void P_DialogDrawer(void)
// alternate text for items that need money
if(currentdialog->choices[i].needamounts[0] > 0)
{
+ // haleyjd 20120401: necessary to avoid undefined behavior:
+ strcpy(choicetext2, choicetext);
DEH_snprintf(choicetext, sizeof(choicetext),
"%s for %d",
- choicetext,
+ choicetext2,
currentdialog->choices[i].needamounts[0]);
}
diff --git a/src/strife/p_inter.c b/src/strife/p_inter.c
index 4a7a173d..9bedd78c 100644
--- a/src/strife/p_inter.c
+++ b/src/strife/p_inter.c
@@ -260,7 +260,6 @@ boolean P_GiveBody(player_t* player, int num)
// Set mo->health for consistency.
// haleyjd 20110225: Seems Strife can call this on a NULL player->mo
// when giving items to players that are not in the game...
- // STRIFE-FIXME: needs major verification!
mo = P_SubstNullMobj(player->mo);
mo->health = player->health;
}
@@ -287,7 +286,7 @@ boolean P_GiveBody(player_t* player, int num)
if(player->health >= healing)
return false;
- // Set health. Oddly, mo->health is NOT set here...
+ // Set health. BUG: Oddly, mo->health is NOT set here...
player->health = healing;
}