From: Tobias Oetiker Date: Sun, 22 Oct 2006 21:09:27 +0000 (+0000) Subject: check if valid control codes are in use X-Git-Tag: 1.2.16~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51168aabc8b1a7479708d92461a48ec63e3c9f18;p=thirdparty%2Frrdtool-1.x.git check if valid control codes are in use git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@907 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index a16734ba..70180325 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1446,6 +1446,18 @@ leg_place(image_desc_t *im) } else { prt_fctn = '\0'; } + /* only valid control codes */ + if (prt_fctn != 'l' && + prt_fctn != 'r' && + prt_fctn != 'j' && + prt_fctn != 't' && + prt_fctn != '\0' && + prt_fctn != 'g' ) { + free(legspace); + rrd_set_error("Uknown control code at the end of '%s\\%c'",im->gdes[i].legend,prt_fctn); + return -1; + + } /* remove exess space */ while (prt_fctn=='g' && leg_cc > 0 &&