From f0ffce8cc62db21ac6fd99454e03f8850cc7c5fb Mon Sep 17 00:00:00 2001 From: oetiker Date: Fri, 10 Sep 2010 09:16:49 +0000 Subject: [PATCH] fix use of %s in strftime rrdgraph (G)PRINT commands ... bug (#277) found by Denis, fix by tobi git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3@2129 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_graph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/program/src/rrd_graph.c b/program/src/rrd_graph.c index dcc20241..b9d95475 100644 --- a/program/src/rrd_graph.c +++ b/program/src/rrd_graph.c @@ -1520,7 +1520,7 @@ int print_calc( } } /* prepare printval */ - if ((percent_s = strstr(im->gdes[i].format, "%S")) != NULL) { + if (!im->gdes[i].strftm && (percent_s = strstr(im->gdes[i].format, "%S")) != NULL) { /* Magfact is set to -1 upon entry to print_calc. If it * is still less than 0, then we need to run auto_scale. * Otherwise, put the value into the correct units. If @@ -1534,7 +1534,7 @@ int print_calc( printval /= magfact; } *(++percent_s) = 's'; - } else if (strstr(im->gdes[i].format, "%s") != NULL) { + } else if (!im->gdes[i].strftm && strstr(im->gdes[i].format, "%s") != NULL) { auto_scale(im, &printval, &si_symb, &magfact); } -- 2.30.2