X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_cgi.c;h=7f248ab04f1feac44885bd971bce88bb7d89e889;hb=88ec7a41d5ba332d0a902a17c0ef0cb01d133a30;hp=53c104f08aaa2797bf9fa766b4d8cc4ec861def2;hpb=298b318acaf1147474ab9e97cac37c3608660efd;p=rrdtool.git diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index 53c104f..7f248ab 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -56,6 +56,9 @@ char* includefile(long, char **); /* for how long is the output of the cgi valid ? */ char* rrdgoodfor(long, char **); +/* format at-time specified times using strftime */ +char* printstrftime(long, char**); + /** http protocol needs special format, and GMT time **/ char *http_time(time_t *); @@ -80,7 +83,11 @@ static void calfree (void){ /* create freeable version of the string */ char * stralloc(char *str){ - char *nstr = malloc((strlen(str)+1)*sizeof(char)); + char *nstr; + if (str == NULL) { + return NULL; + } + nstr = malloc((strlen(str)+1)*sizeof(char)); strcpy(nstr,str); return(nstr); } @@ -158,6 +165,7 @@ int main(int argc, char *argv[]) { i += parse(&buffer,i,"= 1) { @@ -373,7 +437,7 @@ char* drawgraph(long argc, char **args){ optind=0; /* reset gnu getopt */ opterr=0; /* reset gnu getopt */ calfree(); - if( rrd_graph(argc+1, args-1, &calcpr, &xsize, &ysize) != -1 ) { + if( rrd_graph(argc+1, args-1, &calcpr, &xsize, &ysize, NULL) != -1 ) { return stralloc(calcpr[0]); } else { if (rrd_test_error()) {