From 00ebe5151b540eeed421e24e4cc4eb6061234cc8 Mon Sep 17 00:00:00 2001 From: oetiker Date: Fri, 6 Jun 2008 16:38:25 +0000 Subject: [PATCH] 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/trunk@1403 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_graph.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index b3579273..a503ca3c 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -4126,18 +4126,20 @@ void rrd_graph_options( if (size > 0) { im->text_prop[propidx].size = size; } - if ((int) strlen(prop) > end) { - if (prop[end] == ':') { + if ((int) strlen(optarg) > end) { + if (optarg[end] == ':') { strncpy(im->text_prop[propidx].font, - prop + end + 1, 255); + optarg + end + 1, 255); im->text_prop[propidx].font[255] = '\0'; } else { rrd_set_error - ("expected after font size in '%s'", - prop); + ("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; } -- 2.30.2