]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_graph_helper.c: fix gcc warning "comparison is always false"
authorMarek Schimara <Marek.Schimara@bull.net>
Thu, 1 Sep 2016 09:11:31 +0000 (11:11 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Fri, 2 Sep 2016 13:31:38 +0000 (15:31 +0200)
rrd_graph_helper.c:747:25: warning: comparison is always false due to limited range of data type [-Wtype-limits]
     if (vname && (*vname>128)) {
                         ^

        Effectively, as 'vname' is a (char *), the values can go from
        -128 to 127, so this was deadcode.

src/rrd_graph_helper.c

index 4afd51d4bec5bcdc411160918606f34ca7c76611..f0e7eec8953bb94d9838e16421affb7c09e27a21 100644 (file)
@@ -742,13 +742,6 @@ static graph_desc_t* newGraphDescription(image_desc_t *const im,enum gf_en gf,pa
     if (bitscmp(PARSE_COLOR2) && (! color2) && (h2)) { color2=h2;}
   }
 
-  /* clean up vname escaping on second tries */
-  if (bits & PARSE_RETRY) {
-    if (vname && (*vname>128)) {
-      *vname-=128;
-    }
-  }
-
   /* check if we are reusing the vname */
   if (vname) {
     int idx=find_var(im, vname);