Commit 7aef172a authored by Yang Tse's avatar Yang Tse
Browse files

fix printf-style format strings
parent f47b84b5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -397,13 +397,13 @@ static CURLcode bindlocal(struct connectdata *conn,
              error, Curl_strerror(conn, error));
        return CURLE_INTERFACE_FAILED;
      }
      infof(data, "Local port: %d\n", port);
      infof(data, "Local port: %hu\n", port);
      conn->bits.bound = TRUE;
      return CURLE_OK;
    }

    if(--portnum > 0) {
      infof(data, "Bind to local port %d failed, trying next\n", port);
      infof(data, "Bind to local port %hu failed, trying next\n", port);
      port++; /* try next port */
      /* We re-use/clobber the port variable here below */
      if(sock->sa_family == AF_INET)
+6 −6
Original line number Diff line number Diff line
@@ -882,8 +882,8 @@ CURLcode Curl_convert_to_network(struct SessionHandle *data,
    rc = data->set.convtonetwork(buffer, length);
    if(rc != CURLE_OK) {
      failf(data,
            "CURLOPT_CONV_TO_NETWORK_FUNCTION callback returned %i: %s",
            rc, curl_easy_strerror(rc));
            "CURLOPT_CONV_TO_NETWORK_FUNCTION callback returned %d: %s",
            (int)rc, curl_easy_strerror(rc));
    }
    return(rc);
  }
@@ -943,8 +943,8 @@ CURLcode Curl_convert_from_network(struct SessionHandle *data,
    rc = data->set.convfromnetwork(buffer, length);
    if(rc != CURLE_OK) {
      failf(data,
            "CURLOPT_CONV_FROM_NETWORK_FUNCTION callback returned %i: %s",
            rc, curl_easy_strerror(rc));
            "CURLOPT_CONV_FROM_NETWORK_FUNCTION callback returned %d: %s",
            (int)rc, curl_easy_strerror(rc));
    }
    return(rc);
  }
@@ -1004,8 +1004,8 @@ CURLcode Curl_convert_from_utf8(struct SessionHandle *data,
    rc = data->set.convfromutf8(buffer, length);
    if(rc != CURLE_OK) {
      failf(data,
            "CURLOPT_CONV_FROM_UTF8_FUNCTION callback returned %i: %s",
            rc, curl_easy_strerror(rc));
            "CURLOPT_CONV_FROM_UTF8_FUNCTION callback returned %d: %s",
            (int)rc, curl_easy_strerror(rc));
    }
    return(rc);
  }
+8 −8
Original line number Diff line number Diff line
@@ -882,7 +882,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
        /* The requested bind address is not local.  Use the address used for
         * the control connection instead and restart the port loop
         */
        failf(data, "bind(port=%i) failed: %s", port,
        failf(data, "bind(port=%hu) failed: %s", port,
              Curl_strerror(conn, error) );

        sslen = sizeof(ss);
@@ -896,7 +896,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
        continue;
      }
      else if(error != EADDRINUSE && error != EACCES) {
        failf(data, "bind(port=%i) failed: %s", port,
        failf(data, "bind(port=%hu) failed: %s", port,
              Curl_strerror(conn, error) );
        sclose(portsock);
        return CURLE_FTP_PORT_FAILED;
@@ -978,7 +978,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
       * EPRT |2|1080::8:800:200C:417A|5282|
       */

      result = Curl_pp_sendf(&ftpc->pp, "%s |%d|%s|%d|", mode[fcmd],
      result = Curl_pp_sendf(&ftpc->pp, "%s |%d|%s|%hu|", mode[fcmd],
                             sa->sa_family == AF_INET?1:2,
                             myhost, port);
      if(result)
@@ -999,7 +999,7 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
        source++;
      }
      *dest = 0;
      snprintf(dest, 20, ",%d,%d", port>>8, port&0xff);
      snprintf(dest, 20, ",%d,%d", (int)(port>>8), (int)(port&0xff));

      result = Curl_pp_sendf(&ftpc->pp, "%s %s", mode[fcmd], tmp);
      if(result)
@@ -1623,7 +1623,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
      (unsigned short)conn->port; /* we connect to the proxy's port */

    if(!addr) {
      failf(data, "Can't resolve proxy host %s:%d",
      failf(data, "Can't resolve proxy host %s:%hu",
            conn->proxy.name, connectport);
      return CURLE_FTP_CANT_GET_HOST;
    }
@@ -1638,7 +1638,7 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
    connectport = newport; /* we connect to the remote port */

    if(!addr) {
      failf(data, "Can't resolve new host %s:%d", newhost, connectport);
      failf(data, "Can't resolve new host %s:%hu", newhost, connectport);
      return CURLE_FTP_CANT_GET_HOST;
    }
  }
@@ -2420,7 +2420,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn)
          break;
        default:
          failf(data, "unsupported parameter to CURLOPT_FTPSSLAUTH: %d",
                data->set.ftpsslauth);
                (int)data->set.ftpsslauth);
          return CURLE_FAILED_INIT; /* we don't know what to do */
        }
        PPSENDF(&ftpc->pp, "AUTH %s", ftpauth[ftpc->count1]);
@@ -3367,7 +3367,7 @@ static CURLcode ftp_nextconnect(struct connectdata *conn)
    result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);

  /* end of transfer */
  DEBUGF(infof(data, "DO-MORE phase ends with %d\n", result));
  DEBUGF(infof(data, "DO-MORE phase ends with %d\n", (int)result));

  return result;
}
+7 −7
Original line number Diff line number Diff line
@@ -1305,7 +1305,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
      char *host_port;
      Curl_send_buffer *req_buffer;

      infof(data, "Establish HTTP proxy tunnel to %s:%d\n",
      infof(data, "Establish HTTP proxy tunnel to %s:%hu\n",
            hostname, remote_port);

      if(data->req.newurl) {
@@ -1322,7 +1322,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
      if(!req_buffer)
        return CURLE_OUT_OF_MEMORY;

      host_port = aprintf("%s:%d", hostname, remote_port);
      host_port = aprintf("%s:%hu", hostname, remote_port);
      if(!host_port) {
        free(req_buffer);
        return CURLE_OUT_OF_MEMORY;
@@ -1357,7 +1357,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
        /* BLOCKING */
        result =
          Curl_add_bufferf(req_buffer,
                      "CONNECT %s:%d HTTP/%s\r\n"
                      "CONNECT %s:%hu HTTP/%s\r\n"
                      "%s"  /* Host: */
                      "%s"  /* Proxy-Authorization */
                      "%s"  /* User-Agent */
@@ -1525,7 +1525,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
                  keepon = FALSE;
                }
                else
                  infof(data, "Read %d bytes of chunk, continue\n",
                  infof(data, "Read %zd bytes of chunk, continue\n",
                        tookcareof);
              }
            }
@@ -1596,7 +1596,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
                           attention so that this is cleared again when this
                           function returns! */
                        k->ignorebody = TRUE;
                        infof(data, "%d bytes of chunk left\n", gotbytes-i);
                        infof(data, "%zd bytes of chunk left\n", gotbytes-i);

                        if(line_start[1] == '\n') {
                          /* this can only be a LF if the letter at index 0
@@ -1615,7 +1615,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
                          keepon = FALSE;
                        }
                        else
                          infof(data, "Read %d bytes of chunk, continue\n",
                          infof(data, "Read %zd bytes of chunk, continue\n",
                                gotbytes);
                      }
                      else {
@@ -2284,7 +2284,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
                                    host,
                                    conn->bits.ipv6_ip?"]":"");
    else
      conn->allocptr.host = aprintf("Host: %s%s%s:%d\r\n",
      conn->allocptr.host = aprintf("Host: %s%s%s:%hu\r\n",
                                    conn->bits.ipv6_ip?"[":"",
                                    host,
                                    conn->bits.ipv6_ip?"]":"",
+3 −3
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
    }
    server = ldapssl_init(conn->host.name, (int)conn->port, 1);
    if(server == NULL) {
      failf(data, "LDAP local: Cannot connect to %s:%d",
      failf(data, "LDAP local: Cannot connect to %s:%hu",
              conn->host.name, conn->port);
      status = CURLE_COULDNT_CONNECT;
      goto quit;
@@ -302,7 +302,7 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
    }
    server = ldap_init(conn->host.name, (int)conn->port);
    if(server == NULL) {
      failf(data, "LDAP local: Cannot connect to %s:%d",
      failf(data, "LDAP local: Cannot connect to %s:%hu",
              conn->host.name, conn->port);
      status = CURLE_COULDNT_CONNECT;
      goto quit;
@@ -337,7 +337,7 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
  } else {
    server = ldap_init(conn->host.name, (int)conn->port);
    if(server == NULL) {
      failf(data, "LDAP local: Cannot connect to %s:%d",
      failf(data, "LDAP local: Cannot connect to %s:%hu",
              conn->host.name, conn->port);
      status = CURLE_COULDNT_CONNECT;
      goto quit;
Loading