Return to misc.c CVS log | Up to [local] / src / usr.bin / ssh |
version 1.191, 2024/04/02 09:52:14 | version 1.192, 2024/04/02 09:56:58 | ||
---|---|---|---|
|
|
||
atoi_err(const char *nptr, int *val) | atoi_err(const char *nptr, int *val) | ||
{ | { | ||
const char *errstr = NULL; | const char *errstr = NULL; | ||
long long num; | |||
if (nptr == NULL || *nptr == '\0') | if (nptr == NULL || *nptr == '\0') | ||
return "missing"; | return "missing"; | ||
num = strtonum(nptr, 0, INT_MAX, &errstr); | *val = strtonum(nptr, 0, INT_MAX, &errstr); | ||
if (errstr == NULL) | |||
*val = (int)num; | |||
return errstr; | return errstr; | ||
} | } | ||