Unverified Commit 1a890997 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

all: s/int/size_t cleanup

Assisted-by: Rikard Falkeborn

Closes #2922
parent 9dda13bb
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -250,9 +250,9 @@ static const char *get_top_domain(const char * const domain, size_t *outlen)
  len = strlen(domain);
  last = memrchr(domain, '.', len);
  if(last) {
    first = memrchr(domain, '.', (size_t) (last - domain));
    first = memrchr(domain, '.', (last - domain));
    if(first)
      len -= (size_t) (++first - domain);
      len -= (++first - domain);
  }

  if(outlen)
@@ -717,9 +717,9 @@ Curl_cookie_add(struct Curl_easy *data,
      if(!queryp)
        endslash = strrchr(path, '/');
      else
        endslash = memrchr(path, '/', (size_t)(queryp - path));
        endslash = memrchr(path, '/', (queryp - path));
      if(endslash) {
        size_t pathlen = (size_t)(endslash-path + 1); /* include end slash */
        size_t pathlen = (endslash-path + 1); /* include end slash */
        co->path = malloc(pathlen + 1); /* one extra for the zero byte */
        if(co->path) {
          memcpy(co->path, path, pathlen);
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
@@ -101,7 +101,7 @@ static char *unescape_word(struct Curl_easy *data, const char *inputbuff)
  if(!newp || result)
    return NULL;

  dictp = malloc(((size_t)len)*2 + 1); /* add one for terminating zero */
  dictp = malloc(len*2 + 1); /* add one for terminating zero */
  if(dictp) {
    char *ptr;
    char ch;
+2 −2
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ static CURLcode file_upload(struct connectdata *conn)
  while(!result) {
    size_t nread;
    size_t nwrite;
    int readcount;
    size_t readcount;
    result = Curl_fillreadbuffer(conn, (int)data->set.buffer_size, &readcount);
    if(result)
      break;
@@ -314,7 +314,7 @@ static CURLcode file_upload(struct connectdata *conn)
    if(readcount <= 0)  /* fix questionable compare error. curlvms */
      break;

    nread = (size_t)readcount;
    nread = readcount;

    /*skip bytes before resume point*/
    if(data->state.resume_from) {
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution. The terms
@@ -89,7 +89,7 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done)
  /* Create selector. Degenerate cases: / and /1 => convert to "" */
  if(strlen(path) <= 2) {
    sel = (char *)"";
    len = (int)strlen(sel);
    len = strlen(sel);
  }
  else {
    char *newp;
+2 −2
Original line number Diff line number Diff line
@@ -610,8 +610,8 @@ static CURLcode smb_send_and_recv(struct connectdata *conn, void **msg)

  /* Check if there is data in the transfer buffer */
  if(!smbc->send_size && smbc->upload_size) {
    int nread = smbc->upload_size > UPLOAD_BUFSIZE ? UPLOAD_BUFSIZE :
      (int) smbc->upload_size;
    size_t nread = smbc->upload_size > UPLOAD_BUFSIZE ? UPLOAD_BUFSIZE :
      smbc->upload_size;
    conn->data->req.upload_fromhere = conn->data->state.ulbuf;
    result = Curl_fillreadbuffer(conn, nread, &nread);
    if(result && result != CURLE_AGAIN)
Loading