diff options
| author | Scott Thomas | 2011-06-03 19:46:43 +0930 | 
|---|---|---|
| committer | Scott Thomas | 2011-06-03 19:47:28 +0930 | 
| commit | e23bd5b92b3643f0b1ddc3dc9a4aaf4a2203d46d (patch) | |
| tree | b9a390089328f61d7488c8698896d44c8a12a628 | |
| parent | 5dc8bb627a2551b351429ff2f9d8de77cd655d4d (diff) | |
| download | scummvm-rg350-e23bd5b92b3643f0b1ddc3dc9a4aaf4a2203d46d.tar.gz scummvm-rg350-e23bd5b92b3643f0b1ddc3dc9a4aaf4a2203d46d.tar.bz2 scummvm-rg350-e23bd5b92b3643f0b1ddc3dc9a4aaf4a2203d46d.zip  | |
GROOVIE: Ensure entire v2 res name is loaded with terminating null
| -rw-r--r-- | engines/groovie/resource.cpp | 13 | 
1 files changed, 7 insertions, 6 deletions
diff --git a/engines/groovie/resource.cpp b/engines/groovie/resource.cpp index 05b43b7d3c..c26f04d6ee 100644 --- a/engines/groovie/resource.cpp +++ b/engines/groovie/resource.cpp @@ -169,7 +169,7 @@ bool ResMan_t7g::getResInfo(uint32 fileRef, ResInfo &resInfo) {  		error("Groovie::Resource: Invalid resource number: 0x%04X (%s)", resNum, rlFileName.c_str());  	} -	// Read the resource name (just for debugging purposes) +	// Read the resource name  	char resname[13];  	rlFile->read(resname, 12);  	resname[12] = 0; @@ -240,7 +240,7 @@ uint32 ResMan_v2::getRef(Common::String name, Common::String scriptname) {  		// Test whether it's the resource we're searching  		Common::String resname(readname, 18);  		if (resname.hasPrefix(name.c_str())) { -			debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource %12s matches %s", readname, name.c_str()); +			debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource %18s matches %s", readname, name.c_str());  			found = true;  		}  	} @@ -279,10 +279,11 @@ bool ResMan_v2::getResInfo(uint32 fileRef, ResInfo &resInfo) {  	resInfo.size = rlFile.readUint32LE();  	resInfo.gjd = rlFile.readUint16LE(); -	// Read the resource name (just for debugging purposes) -	char resname[12]; -	rlFile.read(resname, 12); -	debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource name: %12s", resname); +	// Read the resource name +	char resname[19]; +	resname[18] = 0; +	rlFile.read(resname, 18); +	debugC(2, kGroovieDebugResource | kGroovieDebugAll, "Groovie::Resource: Resource name: %18s", resname);  	resInfo.filename = resname;  	// 6 padding bytes? (it looks like they're always 0)  | 
