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
This commit is contained in:
parent
1e1bbb79fd
commit
674677bd08
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295854
@ -422,11 +422,10 @@ get_num(const char *val)
|
|||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
num = strtoumax(val, &expr, 0);
|
num = strtoumax(val, &expr, 0);
|
||||||
if (errno != 0) /* Overflow or underflow. */
|
|
||||||
err(1, "%s", oper);
|
|
||||||
|
|
||||||
if (expr == val) /* No valid digits. */
|
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);
|
mult = postfix_to_mult(*expr);
|
||||||
|
|
||||||
@ -472,11 +471,10 @@ get_off_t(const char *val)
|
|||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
num = strtoimax(val, &expr, 0);
|
num = strtoimax(val, &expr, 0);
|
||||||
if (errno != 0) /* Overflow or underflow. */
|
|
||||||
err(1, "%s", oper);
|
|
||||||
|
|
||||||
if (expr == val) /* No valid digits. */
|
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);
|
mult = postfix_to_mult(*expr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user