std: Handle NULL pointer argument in c_dir() correctly.

This commit is contained in:
Klaas Freitag 2013-07-04 14:09:05 +02:00 committed by Andreas Schneider
parent e5089943ba
commit 5f9913570a

View file

@ -178,9 +178,11 @@ int c_isdir(const char *path) {
mbchar_t *wpath = c_utf8_to_locale(path);
int re = 0;
if (path != NULL) {
if (_tstat (wpath, &sb) == 0 && S_ISDIR(sb.st_mode)) {
re = 1;
}
}
c_free_locale_string(wpath);
return re;
}