mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 18:24:12 +08:00
mdbx-test: use strtoull() and retry with base=10.
Change-Id: Ica846ed0a13eb4468a45620518b9ccf85e77a764
This commit is contained in:
parent
434f0d5b57
commit
3e9e52e0ce
@ -118,7 +118,12 @@ bool parse_option(int argc, char *const argv[], int &narg, const char *option,
|
|||||||
|
|
||||||
char *suffix = nullptr;
|
char *suffix = nullptr;
|
||||||
errno = 0;
|
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)
|
if (errno)
|
||||||
failure("Option '--%s' expects a numeric value (%s)\n", option,
|
failure("Option '--%s' expects a numeric value (%s)\n", option,
|
||||||
test_strerror(errno));
|
test_strerror(errno));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user