shithub: choc

Download patch

ref: 61e1333c1d39b26c41478df92307543f379e6746
parent: 7298899199a5bb750c66c4b52227e9e979f8d260
author: Simon Howard <[email protected]>
date: Mon Sep 13 14:47:36 EDT 2010

Use DEH_snprintf where appropriate.

Subversion-branch: /branches/strife-branch
Subversion-revision: 2083

--- a/src/strife/m_menu.c
+++ b/src/strife/m_menu.c
@@ -1110,7 +1110,7 @@
         I_Quit();
     else
     {
-        sprintf(buffer, DEH_String("qfmrm%i"), gametic % 8 + 1);
+        DEH_snprintf(buffer, sizeof(buffer), "qfmrm%i", gametic % 8 + 1);
         I_StartVoice(buffer);
         D_QuitGame();
     }
@@ -1132,8 +1132,8 @@
 //
 void M_QuitStrife(int choice)
 {
-    sprintf(endstring,
-            DEH_String("Do you really want to leave?\n\n" DOSY));
+    DEH_snprintf(endstring, sizeof(endstring),
+                 "Do you really want to leave?\n\n" DOSY);
   
     M_StartMessage(endstring, M_QuitResponse, true);
 }
--- a/src/strife/p_dialog.c
+++ b/src/strife/p_dialog.c
@@ -447,7 +447,7 @@
     int  lumpnum;
 
     // load the SCRIPTxy lump corresponding to MAPxy, if it exists.
-    sprintf(lumpname, DEH_String("script%02d"), gamemap);
+    DEH_snprintf(lumpname, sizeof(lumpname), "script%02d", gamemap);
     if((lumpnum = W_CheckNumForName(lumpname)) == -1)
         numleveldialogs = 0;
     else
--- a/src/strife/p_inter.c
+++ b/src/strife/p_inter.c
@@ -646,9 +646,10 @@
             source->player->frags[target->player-players]++;
 
             // villsa [STRIFE] new messages when fragging players
-            sprintf(plrkilledmsg, DEH_String("%s killed %s"),
-                    pnameprefixes[source->player->mo->miscdata],
-                    pnameprefixes[target->player->mo->miscdata]);
+            DEH_snprintf(plrkilledmsg, sizeof(plrkilledmsg),
+                         "%s killed %s",
+                         pnameprefixes[source->player->mo->miscdata],
+                         pnameprefixes[target->player->mo->miscdata]);
 
             if(netgame)
                 players[consoleplayer].message = plrkilledmsg;