Skip to content

Commit

Permalink
check the match before using items[n]
Browse files Browse the repository at this point in the history
  • Loading branch information
kkos committed Sep 24, 2020
1 parent a4aaa67 commit e119585
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,15 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
for (i = 0; i < ncs[0]; i++) {
for (j = 0; j < ncs[1]; j++) {
for (k = 0; k < ncs[2]; k++) {
if (cs[0][i] == orig_codes[0] && cs[1][j] == orig_codes[1] &&
cs[2][k] == orig_codes[2])
continue;

items[n].byte_len = lens[2];
items[n].code_len = 3;
items[n].code[0] = cs[0][i];
items[n].code[1] = cs[1][j];
items[n].code[2] = cs[2][k];
if (items[n].code[0] == orig_codes[0] &&
items[n].code[1] == orig_codes[1] &&
items[n].code[2] == orig_codes[2])
continue;
n++;
}
}
Expand Down

0 comments on commit e119585

Please sign in to comment.