From: robertl Date: Mon, 1 Nov 2004 17:37:16 +0000 (+0000) Subject: Let xstrdup clone null strings into empty strings. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~3872 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=57d8607e8e9f5c2bc452a43f008b5fd01e27c782;p=gpsbabel.git Let xstrdup clone null strings into empty strings. --- diff --git a/gpsbabel/util.c b/gpsbabel/util.c index 975b7598f..c58520ac0 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -121,7 +121,7 @@ XSTRDUP(const char *s, DEBUG_PARAMS ) xstrdup(const char *s) #endif { - char *o = strdup(s); + char *o = s ? strdup(s) : strdup(""); #ifdef DEBUG_MEM debug_mem_output( "strdup, %x, %x, %s, %d\n", o, s, file, line );