diff options
author | trasz <trasz@FreeBSD.org> | 2016-02-21 14:36:50 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2016-02-21 14:36:50 +0000 |
commit | c5bee1a6aa9165429481650fdd1a309113ee83bd (patch) | |
tree | 47b0f98fc5629732ca167835b588dc3049c5d3d8 /bin | |
parent | 579b7ad49fdbcb4dd1e016603c5d0774b32c12d1 (diff) | |
download | FreeBSD-src-c5bee1a6aa9165429481650fdd1a309113ee83bd.zip FreeBSD-src-c5bee1a6aa9165429481650fdd1a309113ee83bd.tar.gz |
Make the "invalid numeric value" error message actually displayable
(was a dead code before).
Submitted by: bde@ (earlier version)
Reviewed by: bde@
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'bin')
-rw-r--r-- | bin/dd/args.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/bin/dd/args.c b/bin/dd/args.c index db8d445..4607d67 100644 --- a/bin/dd/args.c +++ b/bin/dd/args.c @@ -422,11 +422,10 @@ get_num(const char *val) errno = 0; num = strtoumax(val, &expr, 0); - if (errno != 0) /* Overflow or underflow. */ - err(1, "%s", oper); - if (expr == val) /* No valid digits. */ - errx(1, "%s: illegal numeric value", oper); + errx(1, "%s: invalid numeric value", oper); + if (errno != 0) + err(1, "%s", oper); mult = postfix_to_mult(*expr); @@ -472,11 +471,10 @@ get_off_t(const char *val) errno = 0; num = strtoimax(val, &expr, 0); - if (errno != 0) /* Overflow or underflow. */ - err(1, "%s", oper); - if (expr == val) /* No valid digits. */ - errx(1, "%s: illegal numeric value", oper); + errx(1, "%s: invalid numeric value", oper); + if (errno != 0) + err(1, "%s", oper); mult = postfix_to_mult(*expr); |