cygwin: Fix crash if env var name starts with non-ASCII char

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2017-06-06 21:10:23 +02:00
parent 41b7ef9e1f
commit 7afc1124b6
1 changed files with 2 additions and 2 deletions

View File

@ -351,7 +351,7 @@ static const unsigned char conv_start_chars[256] =
static inline char
match_first_char (const char *s, unsigned char m)
{
return conv_start_chars[(unsigned) *s] & m;
return conv_start_chars[*(unsigned char *)s] & m;
}
struct win_env&
@ -795,7 +795,7 @@ environ_init (char **envp, int envc)
}
debug_printf ("GetEnvironmentStrings returned %p", rawenv);
lastenviron = envp = win32env_to_cygenv (rawenv, true);
lastenviron = envp = win32env_to_cygenv (rawenv, true);
FreeEnvironmentStringsW (rawenv);