changeset 1217:b237a61e61d3

sprintf didn't use .data member of new arrays
author Grumpy7
date Sun, 09 Jun 2013 17:35:10 +0200
parents de876af42e0d
children 85bdbaa539f4 8ee5f1554b64 766ec1e7f4ea
files Monsters.cpp UIHouses.cpp UIPopup.cpp UISaveLoad.cpp VideoPlayer.cpp mm7_4.cpp
diffstat 6 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/Monsters.cpp	Sun Jun 09 16:30:07 2013 +0200
+++ b/Monsters.cpp	Sun Jun 09 17:35:10 2013 +0200
@@ -1124,7 +1124,7 @@
                                     pInfos[curr_rec_num].field_3C_some_special_attack = pMonsterList->GetMonsterIDByName(pTmpBuf.data()) + 1;
                                     if ( pInfos[curr_rec_num].field_3C_some_special_attack == -1 )
                                         {
-                                        sprintf(Src, "Can't create random monster: '%s' See MapStats!", pTmpBuf);
+                                        sprintf(Src, "Can't create random monster: '%s' See MapStats!", pTmpBuf.data());
                                         MessageBoxA(nullptr, Src, "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Itemdata.cpp:2239", 0);
                                         }
                                     }
--- a/UIHouses.cpp	Sun Jun 09 16:30:07 2013 +0200
+++ b/UIHouses.cpp	Sun Jun 09 17:35:10 2013 +0200
@@ -1828,8 +1828,8 @@
         v46 = &v50;
         v45 = (unsigned int)&v49;
         v44 = &v48;
-        v43 = pTmpBuf2;*/
-        sprintf(pTmpBuf.data(), "%s\n \n%s%s%s%s%s", pTmpBuf2, v48[0], v48[1], v48[2], v48[3], v48[4]);
+        v43 = pTmpBuf2.data();*/
+        sprintf(pTmpBuf.data(), "%s\n \n%s%s%s%s%s", pTmpBuf2.data(), v48[0], v48[1], v48[2], v48[3], v48[4]);
         v53.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u);
       }
       else
@@ -2062,7 +2062,7 @@
 		v7 = v5->pName;
 		v8 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
 		sprintf(pTmpBuf.data(), "\f%05d%s\f%05d", v8, v7, v6);
-		sprintf(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf, 100 * v5->uLevel);
+		sprintf(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf.data(), 100 * v5->uLevel);
 		current_npc_text = pTmpBuf2.data();
 		memcpy(&a1, pDialogueWindow, sizeof(a1));
 		w.uFrameWidth = 458;
--- a/UIPopup.cpp	Sun Jun 09 16:30:07 2013 +0200
+++ b/UIPopup.cpp	Sun Jun 09 17:35:10 2013 +0200
@@ -1694,7 +1694,7 @@
       sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[538], v16, v15 + 1);
       strcat(pTmpBuf.data(), "\n");
       strcat(pTmpBuf.data(), pTmpBuf2.data());
-      sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf);
+      sprintf(pTmpBuf2.data(), "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf.data());
       if ( pGlobalTXT_LocalizationStrings[83] && pTmpBuf2.data() )
         sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[83], pTmpBuf2.data());
       break;
--- a/UISaveLoad.cpp	Sun Jun 09 16:30:07 2013 +0200
+++ b/UISaveLoad.cpp	Sun Jun 09 17:35:10 2013 +0200
@@ -179,7 +179,7 @@
     auto day = aDayNames[HIDWORD(pOurHour) % 7];
     auto ampm = aAMPMNames[HIDWORD(pAMPM2)];
     auto month = aMonthNames[pMonthNum];
-    //sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID);
+    //sprintf(pTmpBuf.data(), "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID);
     sprintf(pTmpBuf.data(), "%s %d:%02d%s\n%d %s %d", day, pHour, pMinutes, ampm, 7 * v16 + HIDWORD(pOurHour) % 7 + 1, month, pYear);
     pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf.data(), 3u);
     v1 = 255;
--- a/VideoPlayer.cpp	Sun Jun 09 16:30:07 2013 +0200
+++ b/VideoPlayer.cpp	Sun Jun 09 17:35:10 2013 +0200
@@ -485,7 +485,7 @@
   hMightVid = CreateFileW(L"anims\\might7.vid", GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0x8000080u, 0);
   if ( hMightVid == INVALID_HANDLE_VALUE )
   {
-    sprintf(pTmpBuf2.data(), "Can't open file - anims\\%s.smk", pTmpBuf);
+    sprintf(pTmpBuf2.data(), "Can't open file - anims\\%s.smk", pTmpBuf.data());
     MessageBoxA(0, pTmpBuf2.data(), "Video File Error", 0);
     return;
   }
@@ -495,15 +495,15 @@
   {
     if ( !bCanLoadFromCD )
       {
-       sprintf(pTmpBuf2.data(), "Can't open file - anims\\%s.smk", pTmpBuf);
+       sprintf(pTmpBuf2.data(), "Can't open file - anims\\%s.smk", pTmpBuf.data());
        MessageBoxA(0, pTmpBuf2.data(), "Video File Error", 0);
        return;
 	  }
-    sprintf(pTmpBuf2.data(), "%c:\\%s", (unsigned __int8)cMM7GameCDDriveLetter, pTmpBuf);
+    sprintf(pTmpBuf2.data(), "%c:\\%s", (unsigned __int8)cMM7GameCDDriveLetter, pTmpBuf.data());
     hMagicVid = CreateFileA(pTmpBuf2.data(), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0x8000080u, 0);
     if ( hMagicVid == (HANDLE)INVALID_HANDLE_VALUE )
     {
-	  sprintf(pTmpBuf2.data(), "Can't open file - %s", pTmpBuf);
+	  sprintf(pTmpBuf2.data(), "Can't open file - %s", pTmpBuf.data());
       MessageBoxA(0, pTmpBuf2.data(), "Video File Error", 0);
       return;
     }
--- a/mm7_4.cpp	Sun Jun 09 16:30:07 2013 +0200
+++ b/mm7_4.cpp	Sun Jun 09 17:35:10 2013 +0200
@@ -7293,7 +7293,7 @@
           v31 = *(int *)v29;
           v32 = TargetColor(0xFFu, 0xFFu, 0x9Bu);
           sprintfex(pTmpBuf.data(), "\f%05d%s\f%05d", v32, v31, v30);
-          sprintfex(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf, 100 * (unsigned __int8)v29[8]);
+          sprintfex(pTmpBuf2.data(), dword_F8B1A4, pTmpBuf.data(), 100 * (unsigned __int8)v29[8]);
           current_npc_text = pTmpBuf2.data();
           v15 = "";
           goto LABEL_45;
@@ -7336,7 +7336,7 @@
             if ( uDialogueType != 84 )
               goto LABEL_49;
             sprintf(pTmpBuf.data(), format_4E2D80, v55, pItemsTable->pItems[contract_approved].pUnidentifiedName);
-            sprintf(pTmpBuf2.data(), current_npc_text, pTmpBuf);
+            sprintf(pTmpBuf2.data(), current_npc_text, pTmpBuf.data());
             current_npc_text = pTmpBuf2.data();
             goto LABEL_45;
           }