diff options
| author | David Corrales | 2007-07-08 16:58:54 +0000 | 
|---|---|---|
| committer | David Corrales | 2007-07-08 16:58:54 +0000 | 
| commit | 9bfe5d53540af7dc9bf0214202f4e35b272320ea (patch) | |
| tree | 69dcaf6f735e9fd0913a3e2f163852d4b9af87e3 /backends/saves/default/default-saves.cpp | |
| parent | 256e4d9521b79160d1f9ed670656097a96dc5a34 (diff) | |
| parent | 17da12ca07a1f18f3fe1ef5b0c2c0cd9fd8359b4 (diff) | |
| download | scummvm-rg350-9bfe5d53540af7dc9bf0214202f4e35b272320ea.tar.gz scummvm-rg350-9bfe5d53540af7dc9bf0214202f4e35b272320ea.tar.bz2 scummvm-rg350-9bfe5d53540af7dc9bf0214202f4e35b272320ea.zip  | |
Merged the FSNode branch with trunk r27681:27969
svn-id: r27970
Diffstat (limited to 'backends/saves/default/default-saves.cpp')
| -rw-r--r-- | backends/saves/default/default-saves.cpp | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp index 8c9b0ffd2a..b58dd87d93 100644 --- a/backends/saves/default/default-saves.cpp +++ b/backends/saves/default/default-saves.cpp @@ -187,16 +187,21 @@ void DefaultSaveFileManager::listSavefiles(const char *prefix , bool *marks, int  	search += '*';	//match all files that start with the given prefix  	search.c_str(); //FIXME: subtle bug? removing this line will break things. Looks like the string isn't getting updated. +	assert(marks);  	memset(marks, false, num * sizeof(bool));	//assume no savegames for this title  	if(savePath.lookupFile(savefiles, savePath, search, false, true)) {  		char slot[2]; +		int slotNum;  		for(FSList::const_iterator file = savefiles.begin(); file != savefiles.end(); file++) {  			//TODO: check if this is the behavior for all engines  			//Obtain the last 2 digits of the filename, since they correspond to the save slot  			slot[0] = file->getName()[file->getName().size()-2];  			slot[1] = file->getName()[file->getName().size()-1]; -			marks[atoi(slot)] = true;	//mark this slot as valid +			 +			slotNum = atoi(slot); +			if(slotNum >= 0 && slotNum < num) +				marks[slotNum] = true;	//mark this slot as valid  		}  	}  }  | 
