From: Tobias Oetiker Date: Fri, 6 Jun 2008 16:38:25 +0000 (+0000) Subject: fix for --font bug (font names wer not being picked up at all). Bug reported by ... X-Git-Tag: 1.2.29~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79c3d8b98346e49126afa1735ba9dd761dbd766d;p=thirdparty%2Frrdtool-1.x.git fix for --font bug (font names wer not being picked up at all). Bug reported by Dmitry B. Bigunayk git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1403 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 3ee15825..4d747d08 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -3508,15 +3508,17 @@ rrd_graph_options(int argc, char *argv[],image_desc_t *im) 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); + rrd_set_error("expected : after font size in '%s'",optarg); return; } } + /* only run the for loop for DEFAULT (0) for + all others, we break here. woodo programming */ if (propidx==sindex && sindex != 0) break; } } else {