mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
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.)
This commit is contained in:
@ -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",
|
||||
|
Reference in New Issue
Block a user