From: Tobias Oetiker Date: Wed, 14 Jan 2015 11:16:57 +0000 (+0100) Subject: to include - in an scanf rang it must be at the end not at the beginning of the expre... X-Git-Tag: v1.5.0-rc2~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=172eefbcd00dc42f6ef68a9e38ccac1a1bd3f2c7;p=thirdparty%2Frrdtool-1.x.git to include - in an scanf rang it must be at the end not at the beginning of the expressions --- diff --git a/src/rrd_rpncalc.c b/src/rrd_rpncalc.c index cb969d2c..b30b5fe8 100644 --- a/src/rrd_rpncalc.c +++ b/src/rrd_rpncalc.c @@ -320,7 +320,7 @@ rpnp_t *rpn_parse( return NULL; } - else if ((sscanf(expr, "%19[-0-9.e+]%n", double_str, &pos) == 1) + else if ((sscanf(expr, "%19[0-9.e+-]%n", double_str, &pos) == 1) && (expr[pos] == ',') && ( rrd_strtodbl( double_str, NULL, &(rpnp[steps].val), NULL ) == 2 )) { rpnp[steps].op = OP_NUMBER;