X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_graph.c;h=08071884d67599cec8aea254576273ace120e6f5;hb=ff2c56d197fc76e5f54d37fd8830369ca28d1420;hp=ecf19fd31f2d579a8e59792ae6bb47716170749b;hpb=437147eb1ef8f161b31d234ffb0ef5db9c463678;p=rrdtool.git diff --git a/src/rrd_graph.c b/src/rrd_graph.c index ecf19fd..0807188 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.2.15 Copyright by Tobi Oetiker, 1997-2006 + * RRDtool 1.2.16 Copyright by Tobi Oetiker, 1997-2006 **************************************************************************** * rrd__graph.c produce graphs from data in rrdfiles ****************************************************************************/ @@ -7,10 +7,12 @@ #include +#ifdef WIN32 +#include "strftime.h" +#endif #include "rrd_tool.h" -#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) -#include "strftime.h" +#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) #include #include #endif @@ -1444,7 +1446,26 @@ leg_place(image_desc_t *im) } else { prt_fctn = '\0'; } + /* only valid control codes */ + if (prt_fctn != 'l' && + prt_fctn != 'n' && /* a synonym for l */ + prt_fctn != 'r' && + prt_fctn != 'j' && + prt_fctn != 'c' && + prt_fctn != 't' && + prt_fctn != '\0' && + prt_fctn != 'g' ) { + free(legspace); + rrd_set_error("Unknown control code at the end of '%s\\%c'",im->gdes[i].legend,prt_fctn); + return -1; + + } + /* remove exess space */ + if ( prt_fcnt == 'n' ){ + prt_fcnt='l'; + } + while (prt_fctn=='g' && leg_cc > 0 && im->gdes[i].legend[leg_cc-1]==' '){