From 0e91fcbc043cf363cccf3d6810afdfa0ab77472f Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Mon, 23 Jul 2018 21:15:05 +0100 Subject: [PATCH] Don't use pw when reading the replacement data. --- src/libespeak-ng/dictionary.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/libespeak-ng/dictionary.c b/src/libespeak-ng/dictionary.c index 92bf8d1f..11962952 100644 --- a/src/libespeak-ng/dictionary.c +++ b/src/libespeak-ng/dictionary.c @@ -124,7 +124,6 @@ static void InitGroups(Translator *tr) int ix; char *p; char *p_name; - unsigned int *pw; unsigned char c, c2; int len; @@ -149,11 +148,11 @@ static void InitGroups(Translator *tr) p++; if (p[0] == RULE_REPLACEMENTS) { - pw = (unsigned int *)(((intptr_t)p+4) & ~3); // advance to next word boundary - tr->langopts.replace_chars = pw; - while (pw[0] != 0) - pw += 2; // find the end of the replacement list, each entry is 2 words. - p = (char *)(pw+1); + p = (char *)(((intptr_t)p+4) & ~3); // advance to next word boundary + tr->langopts.replace_chars = (unsigned int *)p; + while (*(unsigned int *)p != 0) + p += 8; // find the end of the replacement list, each entry is 2 words. + p += 4; #ifdef ARCH_BIG pw = (unsigned int *)(tr->langopts.replace_chars);