make str_strdup more forgiving

This commit is contained in:
Enno Rehling 2018-05-09 07:14:56 +02:00
parent f2e6825dab
commit 9e6ae0edc1
1 changed files with 1 additions and 0 deletions

View File

@ -218,6 +218,7 @@ unsigned int wang_hash(unsigned int a)
} }
char *str_strdup(const char *s) { char *str_strdup(const char *s) {
if (s == NULL) return NULL;
#ifdef HAVE_STRDUP #ifdef HAVE_STRDUP
return strdup(s); return strdup(s);
#elif defined(_MSC_VER) #elif defined(_MSC_VER)