Commit 15f832d1 authored by Yang Tse's avatar Yang Tse
Browse files

fix compiler warning

parent c249a8aa
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
      socksreq[6] = 0;
      socksreq[7] = 1;
      /* If still enough room in buffer, also append hostname */
      hostnamelen = strlen(hostname) + 1; /* length including NUL */
      hostnamelen = (ssize_t)strlen(hostname) + 1; /* length including NUL */
      if (packetsize + hostnamelen <= SOCKS4REQLEN)
        strcpy((char*)socksreq + packetsize, hostname);
      else
@@ -255,7 +255,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
    }
    if (protocol4a && hostnamelen == 0) {
      /* SOCKS4a with very long hostname - send that name separately */
      hostnamelen = strlen(hostname) + 1;
      hostnamelen = (ssize_t)strlen(hostname) + 1;
      code = Curl_write(conn, sock, (char *)hostname, hostnamelen, &written);
      if((code != CURLE_OK) || (written != hostnamelen)) {
        failf(data, "Failed to send SOCKS4 connect request.");
@@ -390,7 +390,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
  curl_socket_t sock = conn->sock[sockindex];
  struct SessionHandle *data = conn->data;
  long timeout;
  bool socks5_resolve_local = data->set.proxytype == CURLPROXY_SOCKS5;
  bool socks5_resolve_local = (bool)(data->set.proxytype == CURLPROXY_SOCKS5);
  const size_t hostname_len = strlen(hostname);
  int packetsize = 0;

+3 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2008, 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
@@ -613,7 +613,8 @@ static CURLcode tftp_connect(struct connectdata *conn, bool *done)
     sessionhandle, deal with it */
  Curl_reset_reqproto(conn);

  if(!(state = conn->data->state.proto.tftp)) {
  state = conn->data->state.proto.tftp;
  if(!state) {
    state = conn->data->state.proto.tftp = calloc(sizeof(tftp_state_data_t),
                                                  1);
    if(!state)
+2 −2
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
 *                            | (__| |_| |  _ <| |___
 *                             \___|\___/|_| \_\_____|
 *
 * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
 * Copyright (C) 1998 - 2008, 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
@@ -137,7 +137,7 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp)
  else if(nread == CURL_READFUNC_PAUSE) {
    struct SingleRequest *k = &data->req;
    k->keepon |= KEEP_READ_PAUSE; /* mark reading as paused */
    return 0; /* nothing was read */
    return CURLE_OK; /* nothing was read */
  }
  else if((size_t)nread > buffersize)
    /* the read function returned a too large value */
+1 −1
Original line number Diff line number Diff line
@@ -2138,7 +2138,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
          }
          else {
            GetStr(&postdata, p);
            size = strlen(postdata);
            size = (long)strlen(postdata);
          }

          if(!postdata) {