From 7ab70406f71adae2999b531ae99cb1a8dad11b01 Mon Sep 17 00:00:00 2001 From: oetiker Date: Wed, 14 Feb 2007 06:31:52 +0000 Subject: [PATCH] Printstrftime on rrd_cgi.c returns an illegal value. It causes segmentation fault error. -- Tatsuki Makino tatsuki_makino hotmail.com git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1001 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_cgi.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/program/src/rrd_cgi.c b/program/src/rrd_cgi.c index ad77b670..3ffca6b5 100644 --- a/program/src/rrd_cgi.c +++ b/program/src/rrd_cgi.c @@ -574,7 +574,7 @@ char* printstrftime(long argc, const char **args){ /* Make sure that we were given the right number of args */ if( argc != 4) { rrd_set_error( "wrong number of args %d", argc); - return (char *) -1; + return stralloc(""); } /* Init start and end time */ @@ -584,14 +584,14 @@ char* printstrftime(long argc, const char **args){ /* Parse the start and end times we were given */ if( (parsetime_error = parsetime( args[1], &start_tv))) { rrd_set_error( "start time: %s", parsetime_error); - return (char *) -1; + return stralloc(""); } if( (parsetime_error = parsetime( args[2], &end_tv))) { rrd_set_error( "end time: %s", parsetime_error); - return (char *) -1; + return stralloc(""); } if( proc_start_end( &start_tv, &end_tv, &start_tmp, &end_tmp) == -1) { - return (char *) -1; + return stralloc(""); } /* Do we do the start or end */ @@ -603,7 +603,7 @@ char* printstrftime(long argc, const char **args){ } else { rrd_set_error( "start/end not found in '%s'", args[0]); - return (char *) -1; + return stralloc(""); } /* now format it */ @@ -612,7 +612,7 @@ char* printstrftime(long argc, const char **args){ } else { rrd_set_error( "strftime failed"); - return (char *) -1; + return stralloc(""); } } -- 2.30.2