mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-09-30 21:01:20 +02: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:
parent
9515299485
commit
6b8b4e4d83
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user