From d52f00cd24ad4678d57969918fff53638f79b71a Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Tue, 5 Jan 2016 13:56:34 +0000 Subject: [PATCH] Fix a buffer size calculation in Lookup. --- src/libespeak-ng/dictionary.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index 1784eb7e..90f3e668 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -2909,9 +2909,8 @@ int Lookup(Translator *tr, const char *word, char *ph_out) if (flags[0] & FLAG_TEXTMODE) { say_as = option_sayas; option_sayas = 0; // don't speak replacement word as letter names - text[0] = 0; - strncpy0(&text[1], word1, sizeof(text)); - flags0 = TranslateWord(tr, &text[1], NULL, NULL); + strncpy0(text, word1, sizeof(text)); + flags0 = TranslateWord(tr, text, NULL, NULL); strcpy(ph_out, word_phonemes); option_sayas = say_as; }