From 4340b7cea74203799f7cd5d2457cbe062b42425c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 20 Jun 2006 19:21:14 +0000 Subject: r16426: Klocwork #1544, #1545, #1546, #1549, #1550, #1552, #1553, #1554 Jeremy. (This used to be commit e71cc6647a2eaba0eac95b6abb40745e45db72a4) --- source3/web/cgi.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/web/cgi.c') diff --git a/source3/web/cgi.c b/source3/web/cgi.c index b764b6d628..d289613b4b 100644 --- a/source3/web/cgi.c +++ b/source3/web/cgi.c @@ -223,6 +223,7 @@ void cgi_load_variables(void) browser. Also doesn't allow for variables[] containing multiple variables with the same name and the same or different values. ***************************************************************************/ + const char *cgi_variable(const char *name) { int i; @@ -233,6 +234,20 @@ const char *cgi_variable(const char *name) return NULL; } +/*************************************************************************** + Version of the above that can't return a NULL pointer. +***************************************************************************/ + +const char *cgi_variable_nonull(const char *name) +{ + const char *var = cgi_variable(name); + if (var) { + return var; + } else { + return ""; + } +} + /*************************************************************************** tell a browser about a fatal error in the http processing ***************************************************************************/ -- cgit