]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
fix graph regressions 549/head
authorMathias Kettner <mk@mathias-kettner.de>
Thu, 23 Oct 2014 21:48:52 +0000 (23:48 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Thu, 23 Oct 2014 21:48:52 +0000 (23:48 +0200)
src/rrd_graph_helper.c

index 69d379b44ba69abee025e7cebb27a62d61f62fcf..ea0176db3a44acf8884faf2d378fd07780cbf96d 100644 (file)
@@ -817,7 +817,7 @@ int parse_xport(enum gf_en,parsedargs_t*,image_desc_t *const);
 void legend_shift(char *legend);
 void legend_shift(char *legend)
 {
-  if (!legend) { return; }
+  if (!legend || !legend[0]) { return; }
   memmove(legend+2,legend,strlen(legend));
   legend[0]=' ';
   legend[1]=' ';
@@ -1127,6 +1127,9 @@ int parse_hvrule(enum gf_en gf,parsedargs_t*pa,image_desc_t *const im){
   dprintf("YAXIS : %i\n",gdp->yaxisidx);
   dprintf("=================================\n");
 
+  /* shift the legend by 2 spaces for the "coloured-box"*/
+  legend_shift(gdp->legend);
+
   /* check that vidx is of type VDEF */
   if (gdp->vidx != -1 && im->gdes[gdp->vidx].gf != GF_VDEF) {
     rrd_set_error("Using vname %s of wrong type in line %s\n",