Skip to content

Commit

Permalink
Merge pull request cc65#2415 from polluks/patch-13
Browse files Browse the repository at this point in the history
[grc65] Fixed segv of empty resource file
  • Loading branch information
mrdudz authored Feb 23, 2024
2 parents 8631771 + ab0eb4f commit 5c3ff71
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/grc65/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,11 @@ 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 */
int i;

for (i = 0; tokenTbl[i][0]; i++) {
if (strcmp (tokenTbl[i], token) == 0) {
return i;
if (token != NULL) {
for (i = 0; tokenTbl[i][0]; i++) {
if (strcmp (tokenTbl[i], token) == 0) {
return i;
}
}
}

Expand Down

0 comments on commit 5c3ff71

Please sign in to comment.