Return to misc.c CVS log | Up to [local] / src / usr.bin / ssh |
version 1.119, 2017/11/25 06:46:22 | version 1.120, 2017/12/05 23:59:47 | ||
---|---|---|---|
|
|
||
*errstr = errbuf; | *errstr = errbuf; | ||
return 0; | return 0; | ||
} | } | ||
const char * | |||
atoi_err(const char *nptr, int *val) | |||
{ | |||
const char *errstr = NULL; | |||
long long num; | |||
if (nptr == NULL || *nptr == '\0') | |||
return "missing"; | |||
num = strtonum(nptr, 0, INT_MAX, &errstr); | |||
if (errstr == NULL) | |||
*val = (int)num; | |||
return errstr; | |||
} |