]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
scanf [...] is not regexp [...]
authorTobias Oetiker <tobi@oetiker.ch>
Fri, 6 Feb 2015 14:17:35 +0000 (15:17 +0100)
committerTobias Oetiker <tobi@oetiker.ch>
Fri, 6 Feb 2015 14:17:35 +0000 (15:17 +0100)
src/rrd_graph.c
src/rrd_tune.c

index 89075c498f512f9bf5d0c4c66ff660e47536321f..fcf4c7306ff055113e900b0961d5b163aa2ba91a 100644 (file)
@@ -4678,7 +4678,7 @@ void rrd_graph_options(
                 im->draw_y_grid = 0;
                 break;
             };
-            if (sscanf(optarg, "%[-0-9.e+]:%d", double_str , &im->ylabfact) == 2) {
+            if (sscanf(optarg, "%[0-9.e+-]:%d", double_str , &im->ylabfact) == 2) {
                 if (rrd_strtodbl( double_str, 0, &(im->ygridstep), "option -y") != 2){
                     return;
                 }
@@ -4699,7 +4699,7 @@ void rrd_graph_options(
             break;
         case 1008: /* grid-dash */
             if(sscanf(optarg,
-                      "%[-0-9.e+]:%[-0-9.e+]",
+                      "%[0-9.e+-]:%[0-9.e+-]",
                       double_str,
                       double_str2 ) != 2) {
                 if ( rrd_strtodbl( double_str, 0, &(im->grid_dash_on),NULL) !=2 
@@ -4718,7 +4718,7 @@ void rrd_graph_options(
             break;
         case 1002: /* right y axis */
             if(sscanf(optarg,
-                      "%[-0-9.e+]:%[-0-9.e+]",
+                      "%[0-9.e+-]:%[0-9.e+-]",
                       double_str,
                       double_str2 ) == 2
                 && rrd_strtodbl( double_str, 0, &(im->second_axis_scale),NULL) == 2
@@ -4886,7 +4886,7 @@ void rrd_graph_options(
             double    size = 1;
             int       end;
 
-            if (sscanf(optarg, "%10[A-Z]:%[-0-9.e+]%n", prop, double_str, &end) >= 2
+            if (sscanf(optarg, "%10[A-Z]:%[0-9.e+-]%n", prop, double_str, &end) >= 2
                 && rrd_strtodbl( double_str, 0, &size, NULL) == 2) {
                 int       sindex, propidx;
 
@@ -5149,7 +5149,7 @@ int vdef_parse(
     int       n;
 
     n = 0;
-    sscanf(str, "%20[-0-9.e+],%29[A-Z]%n", double_str, func, &n);
+    sscanf(str, "%20[0-9.e+-],%29[A-Z]%n", double_str, func, &n);
     if ( rrd_strtodbl( double_str, NULL, &param, NULL) != 2 ){
         n = 0;
         sscanf(str, "%29[A-Z]%n", func, &n);
index 21739a67e21515b90ee922b6d1b154e15621ed47..086033a644e0825d28724dba8f1b8a5fc089e261 100644 (file)
@@ -208,7 +208,7 @@ int rrd_tune(
             break;
 
         case 'i':
-            matches = sscanf(optarg, DS_NAM_FMT ":%[-0-9.e+]", ds_nam, double_str);
+            matches = sscanf(optarg, DS_NAM_FMT ":%[0-9.e+-]", ds_nam, double_str);
             if( matches >= 1 ) {
                 strtod_ret_val = rrd_strtodbl( double_str, NULL, &min, NULL );
             }
@@ -228,7 +228,7 @@ int rrd_tune(
             break;
 
         case 'a':
-            matches = sscanf(optarg, DS_NAM_FMT ":%[-0-9.e+]", ds_nam, double_str);
+            matches = sscanf(optarg, DS_NAM_FMT ":%[0-9.e+-]", ds_nam, double_str);
             if( matches >= 1 ) {
                 strtod_ret_val = rrd_strtodbl( double_str, NULL, &max, NULL );
             }