Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6b8b4e4

Browse files
committed
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.)
1 parent9515299 commit6b8b4e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/bin/pgbench/pgbench.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,8 +928,9 @@ makeVariableNumeric(Variable *var)
928928
else/* type should be double */
929929
{
930930
doubledv;
931+
charxs;
931932

932-
if (sscanf(var->value,"%lf",&dv)!=1)
933+
if (sscanf(var->value,"%lf%c",&dv,&xs)!=1)
933934
{
934935
fprintf(stderr,
935936
"malformed variable \"%s\" value: \"%s\"\n",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp