Subject: Re: rrdtool graph "COMMENT:" issue
From: Tobias Oetiker
Date: Sun, 22 Oct 2006 23:08:54 +0200 (CEST)
To: Sulev-Madis Silber

Hi Madis,

well the main problem is that \n is not a valid rrdtool control
code ... try this patch to get a proper error ...

Index: rrd_graph.c
===================================================================
--- rrd_graph.c (revision 906)
+++ rrd_graph.c (working copy)
@@ -1446,6 +1446,18 @@
        } 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 &&


cheers
tobi



> Hello.
>
> I've found rrdtool a very nice tool for almost everything.
> But, when I recently upgraded from 1.2.12 to 1.2.15, I found that
> 'COMMENT:\n', what I use for creating empty lines, is not working anymore. But
> 'COMMENT: \n' works. Can you explain, why is that required? Why i need to put
> a space there, to show empty line, why not just linefeed? I'm sure i'm not the
> only one who has problems with that... :(
>
> Thanks,
> Madis.
>
>
>

-- Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten http://tobi.oetiker.ch tobi@oetiker.ch ++41 62 213 9902