Use proper functions for parsing the numeric values.
Submitted by: bde@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
c00a03a11d
commit
d819236121
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295426
@ -419,7 +419,7 @@ get_num(const char *val)
|
|||||||
char *expr;
|
char *expr;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
num = strtouq(val, &expr, 0);
|
num = strtoumax(val, &expr, 0);
|
||||||
if (errno != 0) /* Overflow or underflow. */
|
if (errno != 0) /* Overflow or underflow. */
|
||||||
err(1, "%s", oper);
|
err(1, "%s", oper);
|
||||||
|
|
||||||
@ -469,7 +469,7 @@ get_off_t(const char *val)
|
|||||||
char *expr;
|
char *expr;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
num = strtoq(val, &expr, 0);
|
num = strtoimax(val, &expr, 0);
|
||||||
if (errno != 0) /* Overflow or underflow. */
|
if (errno != 0) /* Overflow or underflow. */
|
||||||
err(1, "%s", oper);
|
err(1, "%s", oper);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user