From: Simon Ruderich Date: Sat, 10 Aug 2013 23:26:47 +0000 (+0200) Subject: Use %zu to print size_t and ssize_t. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=20c6108edbd40e08b841683d56dbad049ed11d88;p=tlsproxy%2Ftlsproxy.git Use %zu to print size_t and ssize_t. --- diff --git a/src/connection.c b/src/connection.c index 54752ac..07885df 100644 --- a/src/connection.c +++ b/src/connection.c @@ -696,8 +696,8 @@ static int read_from_write_to(int from, int to) { return -1; } if (size_read != size_written) { - LOG(ERROR, "read_from_write_to(): only written %ld of %ld bytes!", - (long int)size_written, (long int)size_read); + LOG(ERROR, "read_from_write_to(): only written %zu of %zu bytes!", + size_written, size_read); return -1; } @@ -724,8 +724,8 @@ static void transfer_data_tls(int client, int server, if (gnutls_record_get_max_size(server_session) < buffer_size) { buffer_size = gnutls_record_get_max_size(server_session); } - LOG(DEBUG2, "transfer_data_tls(): suggested buffer size: %ld", - (long int)buffer_size); + LOG(DEBUG2, "transfer_data_tls(): suggested buffer size: %zu", + buffer_size); for (;;) { int result = poll(fds, 2 /* fd count */, -1 /* no timeout */); @@ -771,8 +771,8 @@ static int read_from_write_to_tls(gnutls_session_t from, char buffer[16384]; /* GnuTLS default maximum */ if (buffer_size > sizeof(buffer)) { - LOG(WARNING, "read_from_write_to_tls(): reduced buffer size to %ld", - (long int)(sizeof(buffer))); + LOG(WARNING, "read_from_write_to_tls(): reduced buffer size to %zu", + sizeof(buffer)); buffer_size = sizeof(buffer); } @@ -793,8 +793,8 @@ static int read_from_write_to_tls(gnutls_session_t from, return -1; } if (size_read != size_written) { - LOG(ERROR, "read_from_write_to_tls(): only written %ld of %ld bytes!", - (long int)size_written, (long int)size_read); + LOG(ERROR, "read_from_write_to_tls(): only written %zu of %zu bytes!", + size_written, size_read); return -1; }