Browse Source

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.
master
Reece H. Dunn 8 years ago
parent
commit
ddc075288c
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/libespeak-ng/voices.c

+ 2
- 1
src/libespeak-ng/voices.c 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;

Loading…
Cancel
Save