[Scummvm-git-logs] scummvm master -> e63fed1916062858ba731e2b448c4a5e4a7d92e8

sev- noreply at scummvm.org
Sat Apr 29 22:09:27 UTC 2023


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b2b06a0e1f WATCHMAKER: Remove strcpy and sprintf usage
e63fed1916 WATCHMAKER: Fix warning


Commit: b2b06a0e1fb609c4111bd5fe4b395b9e66ff3eb5
    https://github.com/scummvm/scummvm/commit/b2b06a0e1fb609c4111bd5fe4b395b9e66ff3eb5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-04-30T00:09:16+02:00

Commit Message:
WATCHMAKER: Remove strcpy and sprintf usage

Changed paths:
    engines/watchmaker/game.cpp


diff --git a/engines/watchmaker/game.cpp b/engines/watchmaker/game.cpp
index fae7ac43f34..04da3c6fa9c 100644
--- a/engines/watchmaker/game.cpp
+++ b/engines/watchmaker/game.cpp
@@ -19,9 +19,6 @@
  *
  */
 
-#define FORBIDDEN_SYMBOL_EXCEPTION_strcpy
-#define FORBIDDEN_SYMBOL_EXCEPTION_sprintf
-
 #include "watchmaker/game.h"
 #include "watchmaker/windows_hacks.h"
 #include "watchmaker/classes/do_system.h"
@@ -122,32 +119,32 @@ bool WGame::CheckAndLoadMoglieSupervisoreModel(int32 c) {
 	if (c == ocMOGLIESUPERVISORE) {
 		if (bMoglieGym && (!Character[c]->Body->name.contains("MoglieGym"))) {
 			CharName_Strings[c] = "MoglieGym.t3d";
-			strcpy(RemoveName, "MoglieSwim.t3d");
+			Common::strlcpy(RemoveName, "MoglieSwim.t3d", 128);
 			CharNameHI_Strings[c] = "MoglieGymHI.t3d";
-			strcpy(RemoveNameHI, "MoglieSwimHI.t3d");
+			Common::strlcpy(RemoveNameHI, "MoglieSwimHI.t3d", 128);
 		}
 
 		if ((!bMoglieGym) && (!Character[c]->Body->name.contains("MoglieSwim"))) {
 			CharName_Strings[c] = "MoglieSwim.t3d";
-			strcpy(RemoveName, "MoglieGym.t3d");
+			Common::strlcpy(RemoveName, "MoglieGym.t3d", 128);
 			CharNameHI_Strings[c] = "MoglieSwimHI.t3d";
-			strcpy(RemoveNameHI, "MoglieGymHI.t3d");
+			Common::strlcpy(RemoveNameHI, "MoglieGymHI.t3d", 128);
 		}
 	}
 
 	if (c == ocMOGLIE_KIMONO) {
 		if (bMoglieSangue && (!Character[c]->Body->name.contains("MoglieKimonoSangue"))) {
 			CharName_Strings[c] = "MoglieKimonoSangue.t3d";
-			strcpy(RemoveName, "MoglieKimono.t3d");
+			Common::strlcpy(RemoveName, "MoglieKimono.t3d", 128);
 			CharNameHI_Strings[c] = "MoglieKimonoSangueHI.t3d";
-			strcpy(RemoveNameHI, "MoglieKimonoHI.t3d");
+			Common::strlcpy(RemoveNameHI, "MoglieKimonoHI.t3d", 128);
 		}
 
 		if ((!bMoglieSangue) && (!Character[c]->Body->name.contains("MoglieKimono"))) {
 			CharName_Strings[c] = "MoglieKimono.t3d";
-			strcpy(RemoveName, "MoglieKimonoSangue.t3d");
+			Common::strlcpy(RemoveName, "MoglieKimonoSangue.t3d", 128);
 			CharNameHI_Strings[c] = "MoglieKimonoHI.t3d";
-			strcpy(RemoveNameHI, "MoglieKimonoSangueHI.t3d");
+			Common::strlcpy(RemoveNameHI, "MoglieKimonoSangueHI.t3d", 128);
 		}
 	}
 
@@ -278,7 +275,7 @@ int WGame::StartPlayingGame(const Common::String &LoaderName_override) {
 	bWideScreen = 0;
 	bTitoliCodaStatic = 0;
 	bTitoliCodaScrolling = 0;
-	strcpy(RoomInfo.name, "");
+	strlcpy(RoomInfo.name, "", 64);
 
 	return true;
 }
@@ -590,7 +587,7 @@ void WGame::LoadMisc() {
 	//TrecLogo = LoadDDBitmap( "TrecLogo.tga", rSURFACESTRETCH );
 
 	for (i = 1; i < 85; i++) {
-		sprintf(str, "I%0#3d.tga", i);
+		snprintf(str, 20, "I%0#3d.tga", i);
 		IconsPics[i] = LoadDDBitmap(*this, str, rSURFACESTRETCH);
 	}
 


Commit: e63fed1916062858ba731e2b448c4a5e4a7d92e8
    https://github.com/scummvm/scummvm/commit/e63fed1916062858ba731e2b448c4a5e4a7d92e8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-04-30T00:09:16+02:00

Commit Message:
WATCHMAKER: Fix warning

Changed paths:
    engines/watchmaker/ll/ll_string.cpp


diff --git a/engines/watchmaker/ll/ll_string.cpp b/engines/watchmaker/ll/ll_string.cpp
index c2ca73b6a6a..ff792f85e07 100644
--- a/engines/watchmaker/ll/ll_string.cpp
+++ b/engines/watchmaker/ll/ll_string.cpp
@@ -291,7 +291,7 @@ void PaintInventory(WGame &game) {
 
 		if (bT2DActive != tOPTIONS) {
 			for (a = 0; a < MAX_SHOWN_ICONS; a++) {
-				if (ci = Inv[CurPlayer][InvBase[CurPlayer] + a]) {
+				if ((ci = Inv[CurPlayer][InvBase[CurPlayer] + a])) {
 					if (CurInvObj == ci)
 						renderer._2dStuff.displayDDText(ObjName[init.InvObj[ci].name], FontKind::Standard, RED_FONT, INV_MARG_SX, INV_MARG_UP + ICON_DY * a, 0, 0, 0, 0);
 					else




More information about the Scummvm-git-logs mailing list