* so the parsing is rather simple. Change if needed.
*/
double param;
- char func[30], double_str[12];
+ char func[30], double_str[21];
int n;
n = 0;
- sscanf(str, "%[-0-9.e+],%29[A-Z]%n", double_str, func, &n);
- rrd_strtoding( double_str, 0, ¶m, "Function vdef_parse" );
- if (n == (int) strlen(str)) { /* matched */
- ;
- } else {
+ sscanf(str, "%20[-0-9.e+],%29[A-Z]%n", double_str, func, &n);
+ if ( rrd_strtoding( str, NULL, ¶m, "Function vdef_parse" ) != 2){
+ rrd_clear_error();
n = 0;
sscanf(str, "%29[A-Z]%n", func, &n);
if (n == (int) strlen(str)) { /* matched */
return NULL;
}
- else if ((sscanf(expr, "%[-0-9.e+]%n", double_str, &pos) == 1)
+ else if ((sscanf(expr, "%19[-0-9.e+]%n", double_str, &pos) == 1)
&& (expr[pos] == ',')
&& ( rrd_strtoding( double_str, 0, &(rpnp[steps].val), "Error while parsing double in rpn_parse" ) == 2 )) {
rpnp[steps].op = OP_NUMBER;