[Scummvm-cvs-logs] CVS: scummvm/gui ThemeNew.cpp,1.7,1.8

Johannes Schickel lordhoto at users.sourceforge.net
Sat Jan 28 15:13:01 CET 2006


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3642

Modified Files:
	ThemeNew.cpp 
Log Message:
Fixes a bug while loading the theme config from the zip file (now the caret should be black).


Index: ThemeNew.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/ThemeNew.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ThemeNew.cpp	28 Jan 2006 23:03:39 -0000	1.7
+++ ThemeNew.cpp	28 Jan 2006 23:11:52 -0000	1.8
@@ -77,11 +77,12 @@
 			unz_file_info fileInfo;
 			unzOpenCurrentFile(zipFile);
 			unzGetCurrentFileInfo(zipFile, &fileInfo, NULL, 0, NULL, 0, NULL, 0);
-			uint8 *buffer = new uint8[fileInfo.uncompressed_size];
+			uint8 *buffer = new uint8[fileInfo.uncompressed_size+1];
 			assert(buffer);
+			memset(buffer, 0, (fileInfo.uncompressed_size+1)*sizeof(uint8));
 			unzReadCurrentFile(zipFile, buffer, fileInfo.uncompressed_size);
 			unzCloseCurrentFile(zipFile);
-			Common::MemoryReadStream stream(buffer, fileInfo.uncompressed_size);
+			Common::MemoryReadStream stream(buffer, fileInfo.uncompressed_size+1);
 			if (!_configFile.loadFromStream(stream)) {
 				warning("Can not find theme config file '%s'", (stylefile + ".ini").c_str());
 				unzClose(zipFile);





More information about the Scummvm-git-logs mailing list