From df023b8657cab232df88d3656aa5d87676bb7254 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 May 2011 16:42:17 -0700 Subject: Tidy up some missing checks for NULL in strlcpy. --- lib/util/string_wrappers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/util/string_wrappers.h b/lib/util/string_wrappers.h index 4a5f51d96bc..80d0b9932aa 100644 --- a/lib/util/string_wrappers.h +++ b/lib/util/string_wrappers.h @@ -42,7 +42,7 @@ size_t __unsafe_string_function_usage_here_size_t__(void); #endif /* HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS */ #define strlcpy_base(dest, src, base, size) \ - strlcpy(dest, src, size-PTR_DIFF(dest,base)) + strlcpy((dest), (src) ? (src) : "", (size)-PTR_DIFF((dest),(base))) /* String copy functions - macro hell below adds 'type checking' (limited, but the best we can do in C) */ -- cgit