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.
This commit is contained in:
Reece H. Dunn
2017-03-19 13:53:14 +00:00
parent 1064d382c9
commit ddc075288c
+2 -1
View File
@@ -20,6 +20,7 @@
#include "config.h"
#include <ctype.h>
#include <wctype.h>
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
@@ -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;