check env var exists before comparing

This commit is contained in:
Dave Murphy 2018-03-18 18:16:14 +00:00
parent b53e334c76
commit a99eb224c1

View File

@ -513,9 +513,10 @@ int main(int argc, char **argv) {
return -1;
}
char *msyscon = getenv("MSYSCON");
if (0 == strcmp(msyscon,"mintty.exe")) {
if (msyscon && 0 == strcmp(msyscon,"mintty.exe")) {
setvbuf(stdout, 0, _IONBF, 0);
}