mirror of
https://github.com/cc65/cc65.git
synced 2024-09-27 04:54:54 +00:00
Merge pull request #2415 from polluks/patch-13
[grc65] Fixed segv of empty resource file
This commit is contained in:
commit
5c3ff714ae
@ -231,11 +231,13 @@ static int findToken (const char * const *tokenTbl, const char *token)
|
|||||||
/* takes as input table of tokens and token, returns position in table or -1 if not found */
|
/* takes as input table of tokens and token, returns position in table or -1 if not found */
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (token != NULL) {
|
||||||
for (i = 0; tokenTbl[i][0]; i++) {
|
for (i = 0; tokenTbl[i][0]; i++) {
|
||||||
if (strcmp (tokenTbl[i], token) == 0) {
|
if (strcmp (tokenTbl[i], token) == 0) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user