[Scummvm-cvs-logs] scummvm master -> d21402ef3c39e8a4664e36417d8192208a21b148

wjp wjp at usecode.org
Sat Jun 25 21:38:35 CEST 2011


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:
d21402ef3c HUGO: Fix incorrect usage of sizeof


Commit: d21402ef3c39e8a4664e36417d8192208a21b148
    https://github.com/scummvm/scummvm/commit/d21402ef3c39e8a4664e36417d8192208a21b148
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-06-25T12:35:17-07:00

Commit Message:
HUGO: Fix incorrect usage of sizeof

Thanks to salty-horse for the report. The new sizes are
the ones that were replaced by sizeof in 399b59a583b.

Changed paths:
    engines/hugo/file_v1d.cpp
    engines/hugo/file_v1w.cpp
    engines/hugo/file_v2d.cpp
    engines/hugo/file_v3d.cpp
    engines/hugo/hugo.cpp



diff --git a/engines/hugo/file_v1d.cpp b/engines/hugo/file_v1d.cpp
index 9ebd9d2..0795923 100644
--- a/engines/hugo/file_v1d.cpp
+++ b/engines/hugo/file_v1d.cpp
@@ -62,7 +62,7 @@ void FileManager_v1d::readOverlay(const int screenNum, image_pt image, const ovl
 	Common::String buf = Common::String(_vm->_text->getScreenNames(screenNum)) + Common::String(ovl_ext[overlayType]);
 
 	if (!Common::File::exists(buf)) {
-		memset(image, 0, sizeof(image));
+		memset(image, 0, kOvlSize);
 		warning("File not found: %s", buf.c_str());
 		return;
 	}
diff --git a/engines/hugo/file_v1w.cpp b/engines/hugo/file_v1w.cpp
index eb2226f..162019d 100644
--- a/engines/hugo/file_v1w.cpp
+++ b/engines/hugo/file_v1w.cpp
@@ -80,7 +80,7 @@ void FileManager_v1w::readOverlay(const int screenNum, image_pt image, ovl_t ove
 		break;
 	}
 	if (i == 0) {
-		memset(image, 0, sizeof(image));
+		memset(image, 0, kOvlSize);
 		return;
 	}
 	_sceneryArchive1.read(tmpImage, kOvlSize);
diff --git a/engines/hugo/file_v2d.cpp b/engines/hugo/file_v2d.cpp
index 2a663ed..7e44e75 100644
--- a/engines/hugo/file_v2d.cpp
+++ b/engines/hugo/file_v2d.cpp
@@ -136,7 +136,7 @@ void FileManager_v2d::readOverlay(const int screenNum, image_pt image, ovl_t ove
 		break;
 	}
 	if (i == 0) {
-		memset(image, 0, sizeof(image));
+		memset(image, 0, kOvlSize);
 		return;
 	}
 
diff --git a/engines/hugo/file_v3d.cpp b/engines/hugo/file_v3d.cpp
index 7ac0ffc..69371bb 100644
--- a/engines/hugo/file_v3d.cpp
+++ b/engines/hugo/file_v3d.cpp
@@ -143,7 +143,7 @@ void FileManager_v3d::readOverlay(const int screenNum, image_pt image, ovl_t ove
 			break;
 		}
 		if (i == 0) {
-			memset(image, 0, sizeof(image));
+			memset(image, 0, kOvlSize);
 			return;
 		}
 
@@ -182,7 +182,7 @@ void FileManager_v3d::readOverlay(const int screenNum, image_pt image, ovl_t ove
 			break;
 		}
 		if (i == 0) {
-			memset(image, 0, sizeof(image));
+			memset(image, 0, kOvlSize);
 			return;
 		}
 
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 7b54c77..df8abf3 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -463,7 +463,7 @@ bool HugoEngine::loadHugoDat() {
 		if (varnt == _gameVariant) {
 			_numStates = numElem;
 			_screenStates = (byte *)malloc(sizeof(byte) * numElem);
-			memset(_screenStates, 0, sizeof(_screenStates));
+			memset(_screenStates, 0, sizeof(byte) * numElem);
 		}
 	}
 






More information about the Scummvm-git-logs mailing list