Browse Source

TranslateClauseWithTerminator: Look out for filling num_wtab (#2093)

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

+ 3
- 3
src/libespeak-ng/translate.c View File

@@ -1497,7 +1497,7 @@ void TranslateClauseWithTerminator(Translator *tr, int *tone_out, char **voice_c
char *pn;
char *pw;
char number_buf[150];
WORD_TAB num_wtab[50]; // copy of 'words', when splitting numbers into parts
WORD_TAB num_wtab[N_CLAUSE_WORDS]; // copy of 'words', when splitting numbers into parts

// start speaking at a specified word position in the text?
count_words++;
@@ -1551,7 +1551,7 @@ void TranslateClauseWithTerminator(Translator *tr, int *tone_out, char **voice_c
if ((n_digits > tr->langopts.max_digits) || (word[0] == '0'))
words[ix].flags |= FLAG_INDIVIDUAL_DIGITS;

while (pn < &number_buf[sizeof(number_buf)-20]) {
while (pn < &number_buf[sizeof(number_buf)-20] && nw < N_CLAUSE_WORDS-1) {
if (!IsDigit09(c = *pw++) && (c != tr->langopts.decimal_sep))
break;

@@ -1588,7 +1588,7 @@ void TranslateClauseWithTerminator(Translator *tr, int *tone_out, char **voice_c
pn[16] = 0;
nw = 0;

for (pw = &number_buf[3]; pw < pn;) {
for (pw = &number_buf[3]; pw < pn && nw < N_CLAUSE_WORDS;) {
// keep wflags for each part, for FLAG_HYPHEN_AFTER
dict_flags = TranslateWord2(tr, pw, &num_wtab[nw++], words[ix].pre_pause);
while (*pw && *pw++ != ' ')

Loading…
Cancel
Save