aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorEugene Sandulenko2005-10-28 18:55:56 +0000
committerEugene Sandulenko2005-10-28 18:55:56 +0000
commiteda2b6f3376513c0e36e55383f8317a5bea6578d (patch)
tree1cb3da68d498d21a501c35ed3f858032d13a542e /scumm
parentf1ac01cdcb814a40b033289f5bf6036eb88bd928 (diff)
downloadscummvm-rg350-eda2b6f3376513c0e36e55383f8317a5bea6578d.tar.gz
scummvm-rg350-eda2b6f3376513c0e36e55383f8317a5bea6578d.tar.bz2
scummvm-rg350-eda2b6f3376513c0e36e55383f8317a5bea6578d.zip
Add dummy entry at end of substResFileNameTable[] and use that like in other
tables. Fixes crash on PSP svn-id: r19343
Diffstat (limited to 'scumm')
-rw-r--r--scumm/scumm.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 5bbea004fc..fad8e7870d 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -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: