}
else if (isdigit ((unsigned char) *arg))
{
- val = atoi (arg);
- while (isdigit ((unsigned char) *arg))
- arg++;
+ char *ep;
+ val = strtol (arg, &ep, 10);
+ arg = ep;
SKIPWS (arg);
}
if (!getnameinfo(&sa2.sa, sa2len,
NULL, 0, servbuff, sizeof(servbuff),
NI_NUMERICSERV))
- port = atoi(servbuff);
+ port = strtol(servbuff, NULL, 10);
(void) sprintf(num, "%u", port);
(void) __write(s, num, strlen(num)+1);
{ socklen_t len = sizeof (from);
/* Search for and process individual options. */
if (!strncmp (cp, "ndots:", sizeof ("ndots:") - 1))
{
- int i = atoi (cp + sizeof ("ndots:") - 1);
+ int i = strtol (cp + sizeof ("ndots:") - 1, NULL, 10);
if (i <= RES_MAXNDOTS)
parser->template.ndots = i;
else
}
else if (!strncmp (cp, "timeout:", sizeof ("timeout:") - 1))
{
- int i = atoi (cp + sizeof ("timeout:") - 1);
+ int i = strtol (cp + sizeof ("timeout:") - 1, NULL, 10);
if (i <= RES_MAXRETRANS)
parser->template.retrans = i;
else
}
else if (!strncmp (cp, "attempts:", sizeof ("attempts:") - 1))
{
- int i = atoi (cp + sizeof ("attempts:") - 1);
+ int i = strtol (cp + sizeof ("attempts:") - 1, NULL, 10);
if (i <= RES_MAXRETRY)
parser->template.retry = i;
else