Add dummy entry at end of substResFileNameTable[] and use that like in other

tables. Fixes crash on PSP

svn-id: r19343
This commit is contained in:
Eugene Sandulenko 2005-10-28 18:55:56 +00:00
parent f1ac01cdcb
commit eda2b6f337

View file

@ -847,6 +847,7 @@ static SubstResFileNames substResFileNameTable[] = {
{ "thinkerk", "ThinkerK", kGenMac },
{ "water", "Water Worries", kGenMac },
#endif
{ NULL, NULL, 0 }
};
static int compareMD5Table(const void *a, const void *b) {
@ -3023,7 +3024,7 @@ static int generateSubstResFileName_(const char *filename, char *buf, int bufsiz
ext = strrchr(filename, '.');
size_t len = (ext != NULL) ? ext - filename : strlen(filename);
for (int i = index; i < ARRAYSIZE(substResFileNameTable); i++) {
for (int i = index; substResFileNameTable[i].winName; i++) {
if (!scumm_strnicmp(filename, substResFileNameTable[i].winName, len)) {
switch (substResFileNameTable[i].genMethod) {
case kGenMac: