From ddc075288c495072466e95bc7b96301d83cce9a6 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sun, 19 Mar 2017 13:53:14 +0000 Subject: [PATCH] Windows: Fix a crash when building the 'en' voice. This occurs in ReadVoiceFile (voices.c) when calling isspace to isolate the attribute name. It happens because the msvc implementation of isspace asserts that the character is in a valid range, which fails for non-ASCII characters. This commit resolves the problem by calling iswspace, which uses the ucd-tools implementation. --- src/libespeak-ng/voices.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libespeak-ng/voices.c b/src/libespeak-ng/voices.c index 5d7a4427..b7ac73f9 100644 --- a/src/libespeak-ng/voices.c +++ b/src/libespeak-ng/voices.c @@ -20,6 +20,7 @@ #include "config.h" #include +#include #include #include #include @@ -291,7 +292,7 @@ static espeak_VOICE *ReadVoiceFile(FILE *f_in, const char *fname, int is_languag while (fgets_strip(linebuf, sizeof(linebuf), f_in) != NULL) { // isolate the attribute name - for (p = linebuf; (*p != 0) && !isspace(*p); p++) ; + for (p = linebuf; (*p != 0) && !iswspace(*p); p++) ; *p++ = 0; if (linebuf[0] == 0) continue;