[rrd-users] problem with changing the font

Tobias Oetiker tobi at oetiker.ch
Fri Jun 6 18:30:45 CEST 2008


Hi Dmitry,

It seem this function is not used all that often :-) it did work
originally but got broken by another bugfix.

here is the patch which will be in the next release.

Index: rrd_graph.c
===================================================================
--- rrd_graph.c (revision 1386)
+++ rrd_graph.c (working copy)
@@ -3508,15 +3508,17 @@
                         if (size > 0){
                               im->text_prop[propidx].size=size;
                       }
-                       if (strlen(prop) > end){
-                          if (prop[end] == ':'){
-                             strncpy(im->text_prop[propidx].font,prop+end+1,255);
+                       if (strlen(optarg) > end){
+                          if (optarg[end] == ':'){
+                             strncpy(im->text_prop[propidx].font,optarg+end+1,255);
                              im->text_prop[propidx].font[255] = '\0';
                           } else {
                              rrd_set_error("expected after font size in '%s'",prop);
                             return;
                           }
                       }
+                      /* only run the for loop for DEFAULT (0) for
+                         all others, we break here. woodo programming */
                       if (propidx==sindex && sindex != 0) break;
                   }
                 } else {

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



More information about the rrd-users mailing list