mirror of
https://github.com/curl/curl.git
synced 2026-08-05 02:06:12 +03:00
atoi: remove atoi usage
This commit is contained in:
parent
cbe67a1b71
commit
5db0a412ff
12 changed files with 36 additions and 22 deletions
|
|
@ -353,8 +353,8 @@ Curl_cookie_add(struct SessionHandle *data,
|
|||
break;
|
||||
}
|
||||
co->expires =
|
||||
atoi((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0]) +
|
||||
(long)now;
|
||||
strtol((*co->maxage=='\"')?&co->maxage[1]:&co->maxage[0],NULL,10)
|
||||
+ (long)now;
|
||||
}
|
||||
else if(Curl_raw_equal("expires", name)) {
|
||||
strstore(&co->expirestr, whatptr);
|
||||
|
|
|
|||
|
|
@ -379,7 +379,7 @@ static int ftp_endofresp(struct pingpong *pp,
|
|||
size_t len = pp->nread_resp;
|
||||
|
||||
if((len > 3) && LASTLINE(line)) {
|
||||
*code = atoi(line);
|
||||
*code = strtol(line, NULL, 10);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ static void _ldap_trace (const char *fmt, ...)
|
|||
|
||||
if(do_trace == -1) {
|
||||
const char *env = getenv("CURL_TRACE");
|
||||
do_trace = (env && atoi(env) > 0);
|
||||
do_trace = (env && strtol(env, NULL, 10) > 0);
|
||||
}
|
||||
if(!do_trace)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ static int smtp_endofresp(struct pingpong *pp, int *resp)
|
|||
return FALSE; /* Nothing for us. */
|
||||
|
||||
if((result = line[3] == ' '))
|
||||
*resp = atoi(line);
|
||||
*resp = strtol(line, NULL, 10);
|
||||
|
||||
line += 4;
|
||||
len -= 4;
|
||||
|
|
|
|||
|
|
@ -4155,7 +4155,7 @@ static CURLcode parse_proxy(struct SessionHandle *data,
|
|||
*prox_portno = 0x0; /* cut off number from host name */
|
||||
prox_portno ++;
|
||||
/* now set the local port number */
|
||||
conn->port = atoi(prox_portno);
|
||||
conn->port = strtol(prox_portno, NULL, 10);
|
||||
}
|
||||
else {
|
||||
/* without a port number after the host name, some people seem to use
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue