fix printf-style format strings

This commit is contained in:
Yang Tse 2010-01-28 15:34:18 +00:00
Родитель ddab9bd2ec
Коммит d65cf7889b
9 изменённых файлов: 26 добавлений и 25 удалений

Просмотреть файл

@ -581,7 +581,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
data->state.os_errno = error; data->state.os_errno = error;
infof(data, "Connection failed\n"); infof(data, "Connection failed\n");
if(trynextip(conn, sockindex, connected)) { if(trynextip(conn, sockindex, connected)) {
failf(data, "Failed connect to %s:%d; %s", failf(data, "Failed connect to %s:%ld; %s",
conn->host.name, conn->port, Curl_strerror(conn, error)); conn->host.name, conn->port, Curl_strerror(conn, error));
code = CURLE_COULDNT_CONNECT; code = CURLE_COULDNT_CONNECT;
} }
@ -601,7 +601,7 @@ CURLcode Curl_is_connected(struct connectdata *conn,
if(trynextip(conn, sockindex, connected)) { if(trynextip(conn, sockindex, connected)) {
error = SOCKERRNO; error = SOCKERRNO;
data->state.os_errno = error; data->state.os_errno = error;
failf(data, "Failed connect to %s:%d; %s", failf(data, "Failed connect to %s:%ld; %s",
conn->host.name, conn->port, Curl_strerror(conn, error)); conn->host.name, conn->port, Curl_strerror(conn, error));
code = CURLE_COULDNT_CONNECT; code = CURLE_COULDNT_CONNECT;
} }

Просмотреть файл

@ -681,7 +681,8 @@ Curl_cookie_add(struct SessionHandle *data,
if(c->running) if(c->running)
/* Only show this when NOT reading the cookies from a file */ /* Only show this when NOT reading the cookies from a file */
infof(data, "%s cookie %s=\"%s\" for domain %s, path %s, expire %d\n", infof(data, "%s cookie %s=\"%s\" for domain %s, path %s, "
"expire %" FORMAT_OFF_T "\n",
replace_old?"Replaced":"Added", co->name, co->value, replace_old?"Replaced":"Added", co->name, co->value,
co->domain, co->path, co->expires); co->domain, co->path, co->expires);

Просмотреть файл

@ -923,7 +923,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
/* Handle the case when the pipe breaks, i.e., the connection /* Handle the case when the pipe breaks, i.e., the connection
we're using gets cleaned up and we're left with nothing. */ we're using gets cleaned up and we're left with nothing. */
if(easy->easy_handle->state.pipe_broke) { if(easy->easy_handle->state.pipe_broke) {
infof(easy->easy_handle, "Pipe broke: handle 0x%x, url = %s\n", infof(easy->easy_handle, "Pipe broke: handle 0x%p, url = %s\n",
easy, easy->easy_handle->state.path); easy, easy->easy_handle->state.path);
if(easy->state != CURLM_STATE_COMPLETED) { if(easy->state != CURLM_STATE_COMPLETED) {
@ -1131,7 +1131,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
case CURLM_STATE_WAITDO: case CURLM_STATE_WAITDO:
/* Wait for our turn to DO when we're pipelining requests */ /* Wait for our turn to DO when we're pipelining requests */
#ifdef DEBUGBUILD #ifdef DEBUGBUILD
infof(easy->easy_handle, "Conn %d send pipe %d inuse %d athead %d\n", infof(easy->easy_handle, "Conn %ld send pipe %d inuse %d athead %d\n",
easy->easy_conn->connectindex, easy->easy_conn->connectindex,
easy->easy_conn->send_pipe->size, easy->easy_conn->send_pipe->size,
easy->easy_conn->writechannel_inuse, easy->easy_conn->writechannel_inuse,
@ -1319,7 +1319,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
} }
#ifdef DEBUGBUILD #ifdef DEBUGBUILD
else { else {
infof(easy->easy_handle, "Conn %d recv pipe %d inuse %d athead %d\n", infof(easy->easy_handle, "Conn %ld recv pipe %d inuse %d athead %d\n",
easy->easy_conn->connectindex, easy->easy_conn->connectindex,
easy->easy_conn->recv_pipe->size, easy->easy_conn->recv_pipe->size,
easy->easy_conn->readchannel_inuse, easy->easy_conn->readchannel_inuse,

Просмотреть файл

@ -380,7 +380,7 @@ CURLcode Curl_rtsp(struct connectdata *conn, bool *done)
result = result =
Curl_add_bufferf(req_buffer, Curl_add_bufferf(req_buffer,
"%s %s RTSP/1.0\r\n" /* Request Stream-URI RTSP/1.0 */ "%s %s RTSP/1.0\r\n" /* Request Stream-URI RTSP/1.0 */
"CSeq: %d\r\n", /* CSeq */ "CSeq: %ld\r\n", /* CSeq */
(p_request ? p_request : ""), p_stream_uri, (p_request ? p_request : ""), p_stream_uri,
rtsp->CSeq_sent); rtsp->CSeq_sent);
if(result) if(result)

Просмотреть файл

@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___ * | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____| * \___|\___/|_| \_\_____|
* *
* Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
* *
* This software is licensed as described in the file COPYING, which * This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms * you should have received as part of this distribution. The terms
@ -54,7 +54,7 @@ CURLcode Curl_speedcheck(struct SessionHandle *data,
/* we have been this slow for long enough, now die */ /* we have been this slow for long enough, now die */
failf(data, failf(data,
"Operation too slow. " "Operation too slow. "
"Less than %d bytes/sec transfered the last %d seconds", "Less than %ld bytes/sec transfered the last %ld seconds",
data->set.low_speed_limit, data->set.low_speed_limit,
data->set.low_speed_time); data->set.low_speed_time);
return CURLE_OPERATION_TIMEDOUT; return CURLE_OPERATION_TIMEDOUT;

Просмотреть файл

@ -483,8 +483,7 @@ int cert_stuff(struct connectdata *conn,
return 0; return 0;
} }
if (!SSL_CTX_add_client_CA(ctx, sk_X509_value(ca, i))) { if (!SSL_CTX_add_client_CA(ctx, sk_X509_value(ca, i))) {
failf(data, "cannot add certificate to client CA list", failf(data, "cannot add certificate to client CA list");
cert_file);
EVP_PKEY_free(pri); EVP_PKEY_free(pri);
X509_free(x509); X509_free(x509);
return 0; return 0;
@ -1735,7 +1734,7 @@ ossl_connect_step2(struct connectdata *conn, int sockindex)
* the SO_ERROR is also lost. * the SO_ERROR is also lost.
*/ */
if(CURLE_SSL_CONNECT_ERROR == rc && errdetail == 0) { if(CURLE_SSL_CONNECT_ERROR == rc && errdetail == 0) {
failf(data, "Unknown SSL protocol error in connection to %s:%d ", failf(data, "Unknown SSL protocol error in connection to %s:%ld ",
conn->host.name, conn->port); conn->host.name, conn->port);
return rc; return rc;
} }

Просмотреть файл

@ -273,8 +273,8 @@ static CURLcode tftp_set_timeouts(tftp_state_data_t *state)
state->retry_time=1; state->retry_time=1;
infof(state->conn->data, infof(state->conn->data,
"set timeouts for state %d; Total %d, retry %d maxtry %d\n", "set timeouts for state %d; Total %ld, retry %d maxtry %d\n",
state->state, (state->max_time-state->start_time), state->state, (long)(state->max_time-state->start_time),
state->retry_time, state->retry_max); state->retry_time, state->retry_max);
/* init RX time */ /* init RX time */
@ -385,7 +385,7 @@ static CURLcode tftp_parse_option_ack(tftp_state_data_t *state,
/* could realloc pkt buffers here, but the spec doesn't call out /* could realloc pkt buffers here, but the spec doesn't call out
* support for the server requesting a bigger blksize than the client * support for the server requesting a bigger blksize than the client
* requests */ * requests */
failf(data, "%s (%d)", failf(data, "%s (%ld)",
"server requested blksize larger than allocated", blksize); "server requested blksize larger than allocated", blksize);
return CURLE_TFTP_ILLEGAL; return CURLE_TFTP_ILLEGAL;
} }
@ -403,7 +403,7 @@ static CURLcode tftp_parse_option_ack(tftp_state_data_t *state,
return CURLE_TFTP_ILLEGAL; return CURLE_TFTP_ILLEGAL;
} }
Curl_pgrsSetDownloadSize(data, tsize); Curl_pgrsSetDownloadSize(data, tsize);
infof(data, "%s (%d)\n", "tsize parsed from OACK", tsize); infof(data, "%s (%ld)\n", "tsize parsed from OACK", tsize);
} }
} }
@ -643,7 +643,8 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
/* Increment the retry count and fail if over the limit */ /* Increment the retry count and fail if over the limit */
state->retries++; state->retries++;
infof(data, infof(data,
"Timeout waiting for block %d ACK. Retries = %d\n", state->retries); "Timeout waiting for block %d ACK. Retries = %d\n",
state->block+1, state->retries);
if(state->retries > state->retry_max) { if(state->retries > state->retry_max) {
state->error = TFTP_ERR_TIMEOUT; state->error = TFTP_ERR_TIMEOUT;
state->state = TFTP_STATE_FIN; state->state = TFTP_STATE_FIN;
@ -761,7 +762,7 @@ static CURLcode tftp_tx(tftp_state_data_t *state, tftp_event_t event)
/* Increment the retry counter and log the timeout */ /* Increment the retry counter and log the timeout */
state->retries++; state->retries++;
infof(data, "Timeout waiting for block %d ACK. " infof(data, "Timeout waiting for block %d ACK. "
" Retries = %d\n", state->retries); " Retries = %d\n", state->block+1, state->retries);
/* Decide if we've had enough */ /* Decide if we've had enough */
if(state->retries > state->retry_max) { if(state->retries > state->retry_max) {
state->error = TFTP_ERR_TIMEOUT; state->error = TFTP_ERR_TIMEOUT;
@ -1149,8 +1150,8 @@ static long tftp_state_timeout(struct connectdata *conn, tftp_event_t *event)
time(&current); time(&current);
if(current > state->max_time) { if(current > state->max_time) {
DEBUGF(infof(conn->data, "timeout: %d > %d\n", DEBUGF(infof(conn->data, "timeout: %ld > %ld\n",
current, state->max_time)); (long)current, (long)state->max_time));
state->error = TFTP_ERR_TIMEOUT; state->error = TFTP_ERR_TIMEOUT;
state->state = TFTP_STATE_FIN; state->state = TFTP_STATE_FIN;
return(0); return(0);

Просмотреть файл

@ -1617,7 +1617,7 @@ CURLcode Curl_follow(struct SessionHandle *data,
if(type == FOLLOW_REDIR) { if(type == FOLLOW_REDIR) {
if((data->set.maxredirs != -1) && if((data->set.maxredirs != -1) &&
(data->set.followlocation >= data->set.maxredirs)) { (data->set.followlocation >= data->set.maxredirs)) {
failf(data,"Maximum (%d) redirects followed", data->set.maxredirs); failf(data,"Maximum (%ld) redirects followed", data->set.maxredirs);
return CURLE_TOO_MANY_REDIRECTS; return CURLE_TOO_MANY_REDIRECTS;
} }

Просмотреть файл

@ -2830,7 +2830,7 @@ ConnectionExists(struct SessionHandle *data,
if(dead) { if(dead) {
check->data = data; check->data = data;
infof(data, "Connection #%d seems to be dead!\n", i); infof(data, "Connection #%ld seems to be dead!\n", i);
Curl_disconnect(check); /* disconnect resources */ Curl_disconnect(check); /* disconnect resources */
data->state.connc->connects[i]=NULL; /* nothing here */ data->state.connc->connects[i]=NULL; /* nothing here */
@ -3056,7 +3056,7 @@ ConnectionStore(struct SessionHandle *data,
/* there was no room available, kill one */ /* there was no room available, kill one */
i = ConnectionKillOne(data); i = ConnectionKillOne(data);
if(-1 != i) if(-1 != i)
infof(data, "Connection (#%d) was killed to make room (holds %d)\n", infof(data, "Connection (#%ld) was killed to make room (holds %ld)\n",
i, data->state.connc->num); i, data->state.connc->num);
else else
infof(data, "This connection did not fit in the connection cache\n"); infof(data, "This connection did not fit in the connection cache\n");
@ -3137,7 +3137,7 @@ static CURLcode ConnectPlease(struct SessionHandle *data,
#ifndef CURL_DISABLE_VERBOSE_STRINGS #ifndef CURL_DISABLE_VERBOSE_STRINGS
char *hostname = conn->bits.proxy?conn->proxy.name:conn->host.name; char *hostname = conn->bits.proxy?conn->proxy.name:conn->host.name;
infof(data, "About to connect() to %s%s port %d (#%d)\n", infof(data, "About to connect() to %s%s port %ld (#%ld)\n",
conn->bits.proxy?"proxy ":"", conn->bits.proxy?"proxy ":"",
hostname, conn->port, conn->connectindex); hostname, conn->port, conn->connectindex);
#else #else
@ -3172,7 +3172,7 @@ static CURLcode ConnectPlease(struct SessionHandle *data,
#ifndef CURL_DISABLE_VERBOSE_STRINGS #ifndef CURL_DISABLE_VERBOSE_STRINGS
static void verboseconnect(struct connectdata *conn) static void verboseconnect(struct connectdata *conn)
{ {
infof(conn->data, "Connected to %s (%s) port %d (#%d)\n", infof(conn->data, "Connected to %s (%s) port %ld (#%ld)\n",
conn->bits.proxy ? conn->proxy.dispname : conn->host.dispname, conn->bits.proxy ? conn->proxy.dispname : conn->host.dispname,
conn->ip_addr_str, conn->port, conn->connectindex); conn->ip_addr_str, conn->port, conn->connectindex);
} }