Stricter strdup.

This commit is contained in:
Hisham 2016-05-30 12:22:22 -03:00
parent 7ededce9b5
commit 4674b4a732

View File

@ -44,8 +44,11 @@ void* xRealloc(void* ptr, size_t size) {
}
char* xStrdup(const char* str) {
if (!str) {
fail();
}
char* data = strdup(str);
if (!data && str) {
if (!data) {
fail();
}
return data;