about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--argp/argp-help.c6
-rw-r--r--argp/argp-parse.c2
-rw-r--r--inet/rexec.c2
-rw-r--r--resolv/res_init.c6
4 files changed, 8 insertions, 8 deletions
diff --git a/argp/argp-help.c b/argp/argp-help.c
index 90a2795cef..f7f1134c80 100644
--- a/argp/argp-help.c
+++ b/argp/argp-help.c
@@ -210,9 +210,9 @@ fill_in_uparams (const struct argp_state *state)
 	      }
 	    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);
 	      }
 
diff --git a/argp/argp-parse.c b/argp/argp-parse.c
index 68dc45417b..1533b43aaf 100644
--- a/argp/argp-parse.c
+++ b/argp/argp-parse.c
@@ -147,7 +147,7 @@ argp_default_parser (int key, char *arg, struct argp_state *state)
       break;
 
     case OPT_HANG:
-      _argp_hang = atoi (arg ? arg : "3600");
+      _argp_hang = arg ? strtol (arg, NULL, 10) : 3600;
       while (_argp_hang-- > 0)
 	__sleep (1);
       break;
diff --git a/inet/rexec.c b/inet/rexec.c
index 064e979d68..c647b7ac34 100644
--- a/inet/rexec.c
+++ b/inet/rexec.c
@@ -134,7 +134,7 @@ retry:
 		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);
diff --git a/resolv/res_init.c b/resolv/res_init.c
index 2c0bea658e..61b958a437 100644
--- a/resolv/res_init.c
+++ b/resolv/res_init.c
@@ -654,7 +654,7 @@ res_setoptions (struct resolv_conf_parser *parser, const char *options)
       /* 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
@@ -662,7 +662,7 @@ res_setoptions (struct resolv_conf_parser *parser, const char *options)
         }
       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
@@ -670,7 +670,7 @@ res_setoptions (struct resolv_conf_parser *parser, const char *options)
         }
       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