Commit 6b8b4e4d authored by Tom Lane's avatar Tom Lane

Fix pgbench's parsing of double values to notice trailing garbage.

Noted by Fabien Coelho, though this isn't exactly his proposed patch.
(The technique used here is borrowed from the zic sources.)
parent 95152994
......@@ -928,8 +928,9 @@ makeVariableNumeric(Variable *var)
else /* type should be double */
{
double dv;
char xs;
if (sscanf(var->value, "%lf", &dv) != 1)
if (sscanf(var->value, "%lf%c", &dv, &xs) != 1)
{
fprintf(stderr,
"malformed variable \"%s\" value: \"%s\"\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment