Commit 5db0a412 authored by Yang Tse's avatar Yang Tse
Browse files

atoi: remove atoi usage

parent cbe67a1b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ int main(int argc, char *argv[])
        } else if (strncasecmp(*argv, "-T", 2) == 0) {
          prttime = 1;
        } else if (strncasecmp(*argv, "-M=", 3) == 0) {
          int m = atoi(*argv + 3);
          long m = strtol(argv+3, NULL, 10);
          switch(m) {
            case   1: url = URL_1M;
                      break;
+2 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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;
Loading