From 95ddd62076702f852171c45310176bd364504e5c Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Tue, 17 Feb 2009 23:15:35 +0000 Subject: Add a string utility function "string_or_null" which can be used to guarantee a non-null string value. Use it in the LDAP dissector. Fixes the crash on Windows (and other platforms) reported in bug 3262. svn path=/trunk/; revision=27478 --- epan/strutil.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'epan/strutil.c') diff --git a/epan/strutil.c b/epan/strutil.c index f89e17a511..724d595314 100644 --- a/epan/strutil.c +++ b/epan/strutil.c @@ -951,3 +951,11 @@ epan_strcasestr(const char *haystack, const char *needle) } return NULL; } + +const char * +string_or_null(const char *string) +{ + if (string) + return string; + return "[NULL]"; +} -- cgit v1.2.3