summaryrefslogtreecommitdiff
path: root/src/strife/p_dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/strife/p_dialog.c')
-rw-r--r--src/strife/p_dialog.c5
1 files changed, 4 insertions, 1 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]);
}