Fixed nasty bug in findPlainGameDescriptor -- contrary to is documentation, it would not return 0 upon failure to find a match, but rather a (0,0) record.

svn-id: r33136
This commit is contained in:
Max Horn 2008-07-20 16:28:06 +00:00
parent a49a3c6aaa
commit 22ab05aa8a
2 changed files with 3 additions and 3 deletions

View File

@ -32,10 +32,10 @@ const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const Pla
const PlainGameDescriptor *g = list;
while (g->gameid) {
if (0 == scumm_stricmp(gameid, g->gameid))
break;
return g;
g++;
}
return g;
return 0;
}
void GameDescriptor::updateDesc(const char *extra) {

View File

@ -48,7 +48,7 @@ struct PlainGameDescriptor {
/**
* Given a list of PlainGameDescriptors, returns the first PlainGameDescriptor
* matching the given gameid. If not match is found return 0.
* The end of the list marked by a PlainGameDescriptor with gameid equal to 0.
* The end of the list must marked by a PlainGameDescriptor with gameid equal to 0.
*/
const PlainGameDescriptor *findPlainGameDescriptor(const char *gameid, const PlainGameDescriptor *list);