From 807c884ac7a0ebb286df6a4896f6eaae8bd9e3ae Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 18 Nov 2001 08:41:16 +0000 Subject: [PATCH] return "" instead of NULL for -- Michael git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@55 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_cgi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/program/src/rrd_cgi.c b/program/src/rrd_cgi.c index e79ecb7c..14ce2d48 100644 --- a/program/src/rrd_cgi.c +++ b/program/src/rrd_cgi.c @@ -211,8 +211,13 @@ char* rrdsetenv(long argc, char **args){ char* rrdgetenv(long argc, char **args){ if (argc != 1) { return stralloc("[ERROR: getenv faild because it did not get 1 argument only]"); - }; - return stralloc(getenv(args[0])); + } + else if (getenv(args[0]) == NULL) { + return stralloc(""); + } + else { + return stralloc(getenv(args[0])); + } } char* rrdgoodfor(long argc, char **args){ -- 2.30.2