diff options
author | Viktor Dukhovni <openssl-users@dukhovni.org> | 2016-04-03 15:21:34 -0400 |
---|---|---|
committer | Viktor Dukhovni <openssl-users@dukhovni.org> | 2016-04-03 15:36:17 -0400 |
commit | c3a7e0c565c5d41e7d9b910a45c2248c2f3d5152 (patch) | |
tree | f50974d71798eb132b997721a05d81675bbad0cb /apps/opt.c | |
parent | bb3bdf0507ac5c9713a7e99d8652085b2f150b06 (diff) |
After saving errno clear it before calls to strtol et. al.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps/opt.c')
-rw-r--r-- | apps/opt.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/opt.c b/apps/opt.c index 462894a938..63d32150cc 100644 --- a/apps/opt.c +++ b/apps/opt.c @@ -373,6 +373,7 @@ int opt_long(const char *value, long *result) long l; char *endp; + errno = 0; l = strtol(value, &endp, 0); if (*endp || endp == value @@ -398,6 +399,7 @@ int opt_imax(const char *value, intmax_t *result) intmax_t m; char *endp; + errno = 0; m = strtoimax(value, &endp, 0); if (*endp || endp == value @@ -420,6 +422,7 @@ int opt_umax(const char *value, uintmax_t *result) uintmax_t m; char *endp; + errno = 0; m = strtoumax(value, &endp, 0); if (*endp || endp == value @@ -445,6 +448,7 @@ int opt_ulong(const char *value, unsigned long *result) char *endptr; unsigned long l; + errno = 0; l = strtoul(value, &endptr, 0); if (*endptr || endptr == value |