diff options
author | David Young <dyoung@hdfgroup.org> | 2020-04-30 20:21:26 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-04-30 20:21:26 (GMT) |
commit | becb9d82928e8bf1e783e310542d5cbfd38fba94 (patch) | |
tree | e4223acb8330aad3decdecb3d7bddb894a0ebab3 | |
parent | a5ca065b7c3805d3408d0af725648d71ac9dcb4c (diff) | |
download | hdf5-becb9d82928e8bf1e783e310542d5cbfd38fba94.zip hdf5-becb9d82928e8bf1e783e310542d5cbfd38fba94.tar.gz hdf5-becb9d82928e8bf1e783e310542d5cbfd38fba94.tar.bz2 |
In fetch_env_ulong(), report a parse that consumes fewer than all
characters differently than other parse failures.
-rw-r--r-- | test/vfd_swmr_common.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/vfd_swmr_common.c b/test/vfd_swmr_common.c index c79610d..bf1cc59 100644 --- a/test/vfd_swmr_common.c +++ b/test/vfd_swmr_common.c @@ -209,10 +209,14 @@ fetch_env_ulong(const char *varname, unsigned long limit, unsigned long *valp) errno = 0; ul = strtoul(tmp, &end, 0); - if ((ul == ULONG_MAX && errno != 0) || end == tmp || *end != '\0') { + if (ul == ULONG_MAX && errno != 0) { fprintf(stderr, "could not parse %s: %s\n", varname, strerror(errno)); return -1; } + if (end == tmp || *end != '\0') { + fprintf(stderr, "could not parse %s\n", varname); + return -1; + } if (ul > limit) { fprintf(stderr, "%s (%lu) out of range\n", varname, ul); return -1; |