[Scummvm-git-logs] scummvm master -> 0acc1c3ea07b13e888913d00cbde36151023ad1c

Strangerke noreply at scummvm.org
Mon May 6 21:28:33 UTC 2024


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

Summary:
0acc1c3ea0 BAGEL: Fix file size before allocating buffer (CIC 1544835) and log format (CIC 1544838) in master_win


Commit: 0acc1c3ea07b13e888913d00cbde36151023ad1c
    https://github.com/scummvm/scummvm/commit/0acc1c3ea07b13e888913d00cbde36151023ad1c
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-06T22:28:26+01:00

Commit Message:
BAGEL: Fix file size before allocating buffer (CIC 1544835) and log format (CIC 1544838) in master_win

Changed paths:
    engines/bagel/baglib/master_win.cpp


diff --git a/engines/bagel/baglib/master_win.cpp b/engines/bagel/baglib/master_win.cpp
index fb959e2ea23..4ecdac409d5 100644
--- a/engines/bagel/baglib/master_win.cpp
+++ b/engines/bagel/baglib/master_win.cpp
@@ -423,7 +423,7 @@ ErrorCode CBagMasterWin::loadFile(const CBofString &wldName, const CBofString &s
 
 	timerStart();
 
-	if (fileExists(wldFileName)) {
+	if (fileExists(wldFileName) && (fileLength(wldFileName) > 0)) {
 		// Force buffer to be big enough so that the entire script
 		// is pre-loaded
 		int length = fileLength(wldFileName);
@@ -494,7 +494,7 @@ ErrorCode CBagMasterWin::loadFile(const CBofString &wldName, const CBofString &s
 	} else {
 		reportError(ERR_FFIND, "Could not find World Script: %s", wldFileName.getBuffer());
 	}
-	logInfo(buildString("Time to Load %s, %ld ms", wldFileName.getBuffer(), timerStop()));
+	logInfo(buildString("Time to Load %s, %u ms", wldFileName.getBuffer(), timerStop()));
 
 	return _errCode;
 }




More information about the Scummvm-git-logs mailing list