Browse Source

RemoveEnding: Watch against looking up before word (#2105)

master
Samuel Thibault 5 months ago
parent
commit
f6ec04a2fb
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/libespeak-ng/dictionary.c

+ 2
- 2
src/libespeak-ng/dictionary.c View File

const char *p; const char *p;
for (i = 0; (p = add_e_exceptions[i]) != NULL; i++) { for (i = 0; (p = add_e_exceptions[i]) != NULL; i++) {
int len = strlen(p); int len = strlen(p);
if (memcmp(p, &word_end[1-len], len) == 0)
if (word_end + 1-len >= word && memcmp(p, &word_end[1-len], len) == 0)
break; break;
} }
if (p == NULL) if (p == NULL)
const char *p; const char *p;
for (i = 0; (p = add_e_additions[i]) != NULL; i++) { for (i = 0; (p = add_e_additions[i]) != NULL; i++) {
int len = strlen(p); int len = strlen(p);
if (memcmp(p, &word_end[1-len], len) == 0) {
if (word_end + 1-len >= word && memcmp(p, &word_end[1-len], len) == 0) {
end_flags |= FLAG_SUFX_E_ADDED; end_flags |= FLAG_SUFX_E_ADDED;
break; break;
} }

Loading…
Cancel
Save