[Scummvm-cvs-logs] SF.net SVN: scummvm:[42284] tools/branches/gsoc2009-gui

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Jul 9 11:15:44 CEST 2009


Revision: 42284
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42284&view=rev
Author:   fingolfin
Date:     2009-07-09 09:15:43 +0000 (Thu, 09 Jul 2009)

Log Message:
-----------
Fix an error, and make another subtle error explicit (both found thanks to useful GCC warnings)

Modified Paths:
--------------
    tools/branches/gsoc2009-gui/compress_gob.cpp
    tools/branches/gsoc2009-gui/compress_saga.cpp

Modified: tools/branches/gsoc2009-gui/compress_gob.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_gob.cpp	2009-07-09 09:12:54 UTC (rev 42283)
+++ tools/branches/gsoc2009-gui/compress_gob.cpp	2009-07-09 09:15:43 UTC (rev 42284)
@@ -111,6 +111,10 @@
 	chunkCount = 1;
 
 // First read: Output filename
+FIXME: The following is an error, you cannot read into getFullPath this way, since
+(a) it is a *const* object, and 
+(b) you are not allowed to read into a string like that -- c_str may point to a tiny storage, for example
+I have no idea what this code is meant to do, so I'll leave it to Remere to clean it up ;)
 	fscanf(gobConf, "%s", stkName.getFullPath().c_str());
 
 // Second read: signature

Modified: tools/branches/gsoc2009-gui/compress_saga.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_saga.cpp	2009-07-09 09:12:54 UTC (rev 42283)
+++ tools/branches/gsoc2009-gui/compress_saga.cpp	2009-07-09 09:15:43 UTC (rev 42284)
@@ -125,7 +125,7 @@
 	char md5str[32+1];
 
 	Common::md5_file(infile->getFullPath().c_str(), md5sum, FILE_MD5_BYTES);
-	print("Input file name: %s\n", infile->getFullPath());
+	print("Input file name: %s\n", infile->getFullPath().c_str());
 	for (j = 0; j < 16; j++) {
 		sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
 	}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list