aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/pgbench/pgbench.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index e0ac131a0e2..a03ab281a5f 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -5019,16 +5019,19 @@ set_random_seed(const char *seed)
}
else
{
- /* parse seed unsigned int value */
+ /* parse unsigned-int seed value */
+ unsigned long ulseed;
char garbage;
- if (sscanf(seed, UINT64_FORMAT "%c", &iseed, &garbage) != 1)
+ /* Don't try to use UINT64_FORMAT here; it might not work for sscanf */
+ if (sscanf(seed, "%lu%c", &ulseed, &garbage) != 1)
{
fprintf(stderr,
"unrecognized random seed option \"%s\": expecting an unsigned integer, \"time\" or \"rand\"\n",
seed);
return false;
}
+ iseed = (uint64) ulseed;
}
if (seed != NULL)