mdbx-test: use strtoull() and retry with base=10.

Change-Id: Ica846ed0a13eb4468a45620518b9ccf85e77a764
This commit is contained in:
Leonid Yuriev 2018-08-13 01:50:29 +03:00
parent 434f0d5b57
commit 3e9e52e0ce

View File

@ -118,7 +118,12 @@ bool parse_option(int argc, char *const argv[], int &narg, const char *option,
char *suffix = nullptr;
errno = 0;
unsigned long raw = strtoul(value_cstr, &suffix, 0);
unsigned long long raw = strtoull(value_cstr, &suffix, 0);
if ((suffix && *suffix) || errno) {
suffix = nullptr;
errno = 0;
raw = strtoull(value_cstr, &suffix, 10);
}
if (errno)
failure("Option '--%s' expects a numeric value (%s)\n", option,
test_strerror(errno));