From c14c60bb37c0e82e92465eb29179bd95e6585c7b Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Fri, 3 Apr 2009 20:33:01 -0700 Subject: [PATCH] xkbcomp: Back out strdup warning cleanup There are some spots in the code that use strdup without checking the argument, so we need this to not segfault. Cleanup later... --- src/xkbcomp/utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xkbcomp/utils.h b/src/xkbcomp/utils.h index acf6e14..f25f3e5 100644 --- a/src/xkbcomp/utils.h +++ b/src/xkbcomp/utils.h @@ -175,7 +175,7 @@ extern int uStrCasePrefix(const char *p, char *str); #endif #ifdef HAVE_STRDUP -#define uStringDup(s1) (strdup(s1)) +#define uStringDup(s1) ((s1) ? strdup(s1) : NULL) #else extern char * uStringDup(const char *s); -- 2.7.4