From: Josef 'Jeff' Sipek Date: Tue, 17 Mar 2020 12:56:13 +0000 (-0400) Subject: global: use %zu directly instead of PRIuSIZE_T X-Git-Tag: 2.3.11.2~531 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=036004497699b9ab178c106ae1c198d7a36516fc;p=thirdparty%2Fdovecot%2Fcore.git global: use %zu directly instead of PRIuSIZE_T --- diff --git a/src/auth/auth-cache.c b/src/auth/auth-cache.c index 6d096c1847..931f6b4257 100644 --- a/src/auth/auth-cache.c +++ b/src/auth/auth-cache.c @@ -214,7 +214,7 @@ static void sig_auth_cache_stats(const siginfo_t *si ATTR_UNUSED, void *context) cache_used = cache->max_size - cache->size_left; i_info("Authentication cache current size: " - "%"PRIuSIZE_T" bytes used of %"PRIuSIZE_T" bytes (%u%%)", + "%zu bytes used of %zu bytes (%u%%)", cache_used, cache->max_size, (unsigned int)(cache_used * 100ULL / cache->max_size)); diff --git a/src/auth/db-checkpassword.c b/src/auth/db-checkpassword.c index a21aa043b9..4e53641703 100644 --- a/src/auth/db-checkpassword.c +++ b/src/auth/db-checkpassword.c @@ -468,7 +468,7 @@ void db_checkpassword_call(struct db_checkpassword *db, output_len += strlen(auth_password); if (output_len > CHECKPASSWORD_MAX_REQUEST_LEN) { e_info(authdb_event(request), - "Username+password combination too long (%"PRIuSIZE_T" bytes)", + "Username+password combination too long (%zu bytes)", output_len); callback(request, DB_CHECKPASSWORD_STATUS_FAILURE, NULL, request_callback); diff --git a/src/director/director-connection.c b/src/director/director-connection.c index 028d3dbcb9..f5a99bfe13 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -202,7 +202,7 @@ director_connection_append_stats(struct director_connection *conn, string_t *str connected_msecs/1000, connected_msecs%1000); } if (o_stream_get_buffer_used_size(conn->output) > 0) { - str_printfa(str, ", %"PRIuSIZE_T" bytes in output buffer", + str_printfa(str, ", %zu bytes in output buffer", o_stream_get_buffer_used_size(conn->output)); } str_printfa(str, ", %zu peak output buffer size", diff --git a/src/doveadm/doveadm-dump-dbox.c b/src/doveadm/doveadm-dump-dbox.c index fd67e1a6ac..c350471b94 100644 --- a/src/doveadm/doveadm-dump-dbox.c +++ b/src/doveadm/doveadm-dump-dbox.c @@ -97,8 +97,8 @@ dump_msg_hdr(struct istream *input, unsigned int hdr_size, uoff_t *msg_size_r) if (i_stream_read_bytes(input, &data, &size, hdr_size) <= 0) { if (size == 0) return FALSE; - i_fatal("Partial message header read at %"PRIuUOFF_T": " - "%"PRIuSIZE_T" bytes", input->v_offset, size); + i_fatal("Partial message header read at %"PRIuUOFF_T": %zu bytes", + input->v_offset, size); } printf("offset %"PRIuUOFF_T":\n", input->v_offset); diff --git a/src/doveadm/doveadm-dump-log.c b/src/doveadm/doveadm-dump-log.c index bae217c47f..1a10917857 100644 --- a/src/doveadm/doveadm-dump-log.c +++ b/src/doveadm/doveadm-dump-log.c @@ -23,7 +23,7 @@ static void dump_hdr(struct istream *input, uint64_t *modseq_r, if (ret < 0 && input->stream_errno != 0) i_fatal("read() failed: %s", i_stream_get_error(input)); if (ret <= 0) { - i_fatal("file hdr read() %"PRIuSIZE_T" != %"PRIuSIZE_T, + i_fatal("file hdr read() %zu != %zu", size, sizeof(hdr)); } memcpy(&hdr, data, sizeof(hdr)); @@ -480,7 +480,7 @@ static int dump_record(struct istream *input, uint64_t *modseq, if (ret <= 0) { if (size == 0) return 0; - i_fatal("rec hdr read() %"PRIuSIZE_T" != %"PRIuSIZE_T, + i_fatal("rec hdr read() %zu != %zu", size, sizeof(hdr)); } memcpy(&hdr, data, sizeof(hdr)); @@ -502,7 +502,7 @@ static int dump_record(struct istream *input, uint64_t *modseq, if (ret < 0 && input->stream_errno != 0) i_fatal("read() failed: %s", i_stream_get_error(input)); if (ret <= 0) { - i_fatal("rec data read() %"PRIuSIZE_T" != %"PRIuSIZE_T, + i_fatal("rec data read() %zu != %zu", size, data_size); } diff --git a/src/doveadm/doveadm-dump-mailboxlog.c b/src/doveadm/doveadm-dump-mailboxlog.c index 511a593b19..4f66da52e3 100644 --- a/src/doveadm/doveadm-dump-mailboxlog.c +++ b/src/doveadm/doveadm-dump-mailboxlog.c @@ -24,7 +24,7 @@ static int dump_record(int fd) return 0; if (ret != sizeof(rec)) { - i_fatal("rec read() %"PRIuSIZE_T" != %"PRIuSIZE_T, + i_fatal("rec read() %zu != %zu", ret, sizeof(rec)); } diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index 8ab402e4e5..9e43aac0c5 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -339,7 +339,7 @@ client_command_stats_append(string_t *str, str_printfa(str, ", %"PRIu64" B in + %"PRIu64, stats->bytes_in, stats->bytes_out); if (buffered_size > 0) - str_printfa(str, "+%"PRIuSIZE_T, buffered_size); + str_printfa(str, "+%zu", buffered_size); str_append(str, " B out"); } diff --git a/src/imap/imap-master-client.c b/src/imap/imap-master-client.c index 9e4b872e97..9b2e2df679 100644 --- a/src/imap/imap-master-client.c +++ b/src/imap/imap-master-client.c @@ -248,8 +248,7 @@ imap_master_client_input_args(struct connection *conn, const char *const *args, !i_stream_add_data(imap_client->input, master_input.client_input->data, master_input.client_input->used)) { - i_error("imap-master: Couldn't add %"PRIuSIZE_T - " bytes to client's input stream", + i_error("imap-master: Couldn't add %zu bytes to client's input stream", master_input.client_input->used); client_destroy(imap_client, "Client initialization failed"); return -1; diff --git a/src/imap/main.c b/src/imap/main.c index 58157a40da..4cf4062463 100644 --- a/src/imap/main.c +++ b/src/imap/main.c @@ -89,7 +89,7 @@ void imap_refresh_proctitle(void) wait_output = TRUE; } if (wait_output) { - str_printfa(title, " - %"PRIuSIZE_T" bytes waiting", + str_printfa(title, " - %zu bytes waiting", o_stream_get_buffer_used_size(client->output)); if (o_stream_is_corked(client->output)) str_append(title, " corked"); diff --git a/src/lib-compression/test-compression.c b/src/lib-compression/test-compression.c index 9096ae522f..d1d48ad090 100644 --- a/src/lib-compression/test-compression.c +++ b/src/lib-compression/test-compression.c @@ -512,7 +512,7 @@ test_compression_handler_random_io(const struct compression_handler *handler) } if (test_has_failed()) { - i_info("Test parameters: size=%"PRIuSIZE_T, + i_info("Test parameters: size=%zu", in_buf_size); } diff --git a/src/lib-dcrypt/istream-decrypt.c b/src/lib-dcrypt/istream-decrypt.c index 96fcc97832..ffa3513340 100644 --- a/src/lib-dcrypt/istream-decrypt.c +++ b/src/lib-dcrypt/istream-decrypt.c @@ -867,7 +867,7 @@ i_stream_decrypt_read(struct istream_private *stream) stream->istream.stream_errno = EINVAL; io_stream_set_error(&stream->iostream, "Header too large " - "(more than %"PRIuSIZE_T" bytes)", + "(more than %zu bytes)", size); return -1; } diff --git a/src/lib-dict/dict-memcached-ascii.c b/src/lib-dict/dict-memcached-ascii.c index 7f6cb9d1dd..970f74dc4b 100644 --- a/src/lib-dict/dict-memcached-ascii.c +++ b/src/lib-dict/dict-memcached-ascii.c @@ -566,7 +566,7 @@ memcached_send_change(struct dict_memcached_ascii_commit_ctx *ctx, switch (change->type) { case DICT_CHANGE_TYPE_SET: state = MEMCACHED_INPUT_STATE_STORED; - str_printfa(ctx->str, "set %s 0 0 %"PRIuSIZE_T"\r\n%s\r\n", + str_printfa(ctx->str, "set %s 0 0 %zu\r\n%s\r\n", key, strlen(change->value.str), change->value.str); break; case DICT_CHANGE_TYPE_UNSET: diff --git a/src/lib-dict/dict-memcached.c b/src/lib-dict/dict-memcached.c index 87773fdc8f..2b82dc6be0 100644 --- a/src/lib-dict/dict-memcached.c +++ b/src/lib-dict/dict-memcached.c @@ -291,7 +291,7 @@ memcached_dict_lookup(struct dict *_dict, pool_t pool, const char *key, key_len = strlen(key); if (key_len > 0xffff) { *error_r = t_strdup_printf( - "memcached: Key is too long (%"PRIuSIZE_T" bytes): %s", key_len, key); + "memcached: Key is too long (%zu bytes): %s", key_len, key); return -1; } diff --git a/src/lib-fs/fs-posix.c b/src/lib-fs/fs-posix.c index 4199e2bdda..1b42da012f 100644 --- a/src/lib-fs/fs-posix.c +++ b/src/lib-fs/fs-posix.c @@ -624,7 +624,7 @@ static int fs_posix_write(struct fs_file *_file, const void *data, size_t size) } if ((size_t)ret != size) { fs_set_error(_file->event, ENOSPC, - "write(%s) returned %"PRIuSIZE_T"/%"PRIuSIZE_T, + "write(%s) returned %zu/%zu", file->full_path, (size_t)ret, size); return -1; } diff --git a/src/lib-fts/fts-filter-stemmer-snowball.c b/src/lib-fts/fts-filter-stemmer-snowball.c index 5bf1f15ed0..96d91fdf14 100644 --- a/src/lib-fts/fts-filter-stemmer-snowball.c +++ b/src/lib-fts/fts-filter-stemmer-snowball.c @@ -84,8 +84,8 @@ fts_filter_stemmer_snowball_filter(struct fts_filter *filter, /* the only reason why this could fail is because of out of memory. */ i_fatal_status(FATAL_OUTOFMEM, - "sb_stemmer_stem(len=%"PRIuSIZE_T") failed: " - "Out of memory", strlen(*token)); + "sb_stemmer_stem(len=%zu) failed: Out of memory", + strlen(*token)); } *token = t_strndup(base, sb_stemmer_length(sp->stemmer)); return 1; diff --git a/src/lib-http/http-client-connection.c b/src/lib-http/http-client-connection.c index 79a7a021bd..ee10f34917 100644 --- a/src/lib-http/http-client-connection.c +++ b/src/lib-http/http-client-connection.c @@ -1532,13 +1532,13 @@ http_client_connection_connected(struct connection *_conn, bool success) if (set->socket_send_buffer_size > 0) { if (net_set_send_buffer_size(_conn->fd_out, set->socket_send_buffer_size) < 0) - i_error("net_set_send_buffer_size(%"PRIuSIZE_T") failed: %m", + i_error("net_set_send_buffer_size(%zu) failed: %m", set->socket_send_buffer_size); } if (set->socket_recv_buffer_size > 0) { if (net_set_recv_buffer_size(_conn->fd_in, set->socket_recv_buffer_size) < 0) - i_error("net_set_recv_buffer_size(%"PRIuSIZE_T") failed: %m", + i_error("net_set_recv_buffer_size(%zu) failed: %m", set->socket_recv_buffer_size); } diff --git a/src/lib-http/http-client-request.c b/src/lib-http/http-client-request.c index eb719715b4..0ea0a08ab5 100644 --- a/src/lib-http/http-client-request.c +++ b/src/lib-http/http-client-request.c @@ -1195,7 +1195,7 @@ int http_client_request_send_more(struct http_client_request *req, o_stream_set_max_buffer_size(output, (size_t)-1); i_assert(req->payload_input->v_offset >= offset); - e_debug(req->event, "Send more (sent %"PRIuUOFF_T", buffered=%"PRIuSIZE_T")", + e_debug(req->event, "Send more (sent %"PRIuUOFF_T", buffered=%zu)", (uoff_t)(req->payload_input->v_offset - offset), o_stream_get_buffer_used_size(output)); diff --git a/src/lib-http/http-server-connection.c b/src/lib-http/http-server-connection.c index 15cc060088..7f175dea77 100644 --- a/src/lib-http/http-server-connection.c +++ b/src/lib-http/http-server-connection.c @@ -1096,13 +1096,13 @@ http_server_connection_create(struct http_server *server, if (set->socket_send_buffer_size > 0) { if (net_set_send_buffer_size(fd_out, set->socket_send_buffer_size) < 0) - i_error("net_set_send_buffer_size(%"PRIuSIZE_T") failed: %m", + i_error("net_set_send_buffer_size(%zu) failed: %m", set->socket_send_buffer_size); } if (set->socket_recv_buffer_size > 0) { if (net_set_recv_buffer_size(fd_in, set->socket_recv_buffer_size) < 0) - i_error("net_set_recv_buffer_size(%"PRIuSIZE_T") failed: %m", + i_error("net_set_recv_buffer_size(%zu) failed: %m", set->socket_recv_buffer_size); } diff --git a/src/lib-http/test-http-payload.c b/src/lib-http/test-http-payload.c index 6b9a4affb4..894ca15b79 100644 --- a/src/lib-http/test-http-payload.c +++ b/src/lib-http/test-http-payload.c @@ -801,7 +801,7 @@ test_client_download_payload_input(struct test_client_request *tcreq) fsize = 0; i_fatal("test client: download: " "payload ended prematurely " - "(at least %"PRIuSIZE_T" bytes left)", fsize); + "(at least %zu bytes left)", fsize); } else if (debug) { i_debug("test client: download: " "finished request for [%u]", @@ -1039,7 +1039,7 @@ test_client_echo_payload_input(struct test_client_request *tcreq) fsize = 0; i_fatal("test client: echo: " "payload ended prematurely " - "(at least %"PRIuSIZE_T" bytes left)", fsize); + "(at least %zu bytes left)", fsize); } else if (debug) { i_debug("test client: echo: " "finished request for [%u]", diff --git a/src/lib-imap-client/imapc-connection.c b/src/lib-imap-client/imapc-connection.c index 5f26fe54c6..dab0fe5440 100644 --- a/src/lib-imap-client/imapc-connection.c +++ b/src/lib-imap-client/imapc-connection.c @@ -1591,7 +1591,7 @@ static void imapc_connection_input(struct imapc_connection *conn) conn->disconnect_reason); } else if (ret == -2) { str_printfa(str, "Server sent too large input " - "(buffer full at %"PRIuSIZE_T")", + "(buffer full at %zu)", i_stream_get_data_size(conn->input)); } else if (conn->ssl_iostream == NULL) { errstr = conn->input->stream_errno == 0 ? "EOF" : @@ -2421,10 +2421,10 @@ void imapc_command_sendvf(struct imapc_command *cmd, imap_append_quoted(cmd->data, arg); else if ((cmd->conn->capabilities & IMAPC_CAPABILITY_LITERALPLUS) != 0) { - str_printfa(cmd->data, "{%"PRIuSIZE_T"+}\r\n%s", + str_printfa(cmd->data, "{%zu+}\r\n%s", strlen(arg), arg); } else { - str_printfa(cmd->data, "{%"PRIuSIZE_T"}\r\n%s", + str_printfa(cmd->data, "{%zu}\r\n%s", strlen(arg), arg); } break; diff --git a/src/lib-imap/imap-bodystructure.c b/src/lib-imap/imap-bodystructure.c index a2d778f807..f98b061b5a 100644 --- a/src/lib-imap/imap-bodystructure.c +++ b/src/lib-imap/imap-bodystructure.c @@ -697,7 +697,7 @@ static bool str_append_nstring(string_t *str, const struct imap_arg *arg) str_append_c(str, '"'); break; case IMAP_ARG_LITERAL: { - str_printfa(str, "{%"PRIuSIZE_T"}\r\n", strlen(cstr)); + str_printfa(str, "{%zu}\r\n", strlen(cstr)); str_append(str, cstr); break; } diff --git a/src/lib-imap/imap-quote.c b/src/lib-imap/imap-quote.c index c86114e8f2..622e21cb79 100644 --- a/src/lib-imap/imap-quote.c +++ b/src/lib-imap/imap-quote.c @@ -46,7 +46,7 @@ imap_append_literal(string_t *dest, const char *src, unsigned int pos) { size_t full_len = pos + strlen(src+pos); - str_printfa(dest, "{%"PRIuSIZE_T"}\r\n", full_len); + str_printfa(dest, "{%zu}\r\n", full_len); buffer_append(dest, src, full_len); } @@ -207,7 +207,7 @@ void imap_append_string_for_humans(string_t *dest, return; } - str_printfa(dest, "{%"PRIuSIZE_T"}\r\n", size - remove_count); + str_printfa(dest, "{%zu}\r\n", size - remove_count); pos = str_len(dest); last_lwsp = TRUE; whitespace_prefix = TRUE; diff --git a/src/lib-imap/imap-util.c b/src/lib-imap/imap-util.c index b6d4258131..dc1ae24466 100644 --- a/src/lib-imap/imap-util.c +++ b/src/lib-imap/imap-util.c @@ -92,7 +92,7 @@ void imap_write_arg(string_t *dest, const struct imap_arg *arg) } case IMAP_ARG_LITERAL: { const char *strarg = imap_arg_as_astring(arg); - str_printfa(dest, "{%"PRIuSIZE_T"}\r\n", + str_printfa(dest, "{%zu}\r\n", strlen(strarg)); str_append(dest, strarg); break; @@ -158,7 +158,7 @@ void imap_write_args_for_human(string_t *dest, const struct imap_arg *args) const char *strarg = imap_arg_as_astring(args); if (strpbrk(strarg, "\r\n") != NULL) { - str_printfa(dest, "<%"PRIuSIZE_T" byte multi-line literal>", + str_printfa(dest, "<%zu byte multi-line literal>", strlen(strarg)); break; } diff --git a/src/lib-imap/test-imap-url.c b/src/lib-imap/test-imap-url.c index 5fbe559985..877d84e450 100644 --- a/src/lib-imap/test-imap-url.c +++ b/src/lib-imap/test-imap-url.c @@ -743,7 +743,7 @@ static void test_imap_url_valid(void) bool equal = urlp->uauth_token_size == urlt->uauth_token_size; size_t i; test_out_quiet(t_strdup_printf( - "url->uauth_token_size = %"PRIuSIZE_T, urlp->uauth_token_size), + "url->uauth_token_size = %zu", urlp->uauth_token_size), equal); if (equal) { diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index 82f74a8a22..14b57b533f 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -509,7 +509,7 @@ int mail_cache_map(struct mail_cache *cache, size_t offset, size_t size, if (ioloop_time != cache->last_mmap_error_time) { cache->last_mmap_error_time = ioloop_time; mail_cache_set_syscall_error(cache, t_strdup_printf( - "mmap(size=%"PRIuSIZE_T")", cache->mmap_length)); + "mmap(size=%zu)", cache->mmap_length)); } cache->mmap_length = 0; return -1; diff --git a/src/lib-index/mail-index-map-hdr.c b/src/lib-index/mail-index-map-hdr.c index 256d6d2e6a..3daa870b98 100644 --- a/src/lib-index/mail-index-map-hdr.c +++ b/src/lib-index/mail-index-map-hdr.c @@ -243,7 +243,7 @@ int mail_index_map_check_header(struct mail_index_map *map, /* following some extra checks that only take a bit of CPU */ if (hdr->record_size < sizeof(struct mail_index_record)) { *error_r = t_strdup_printf( - "record_size too small (%u < %"PRIuSIZE_T")", + "record_size too small (%u < %zu)", hdr->record_size, sizeof(struct mail_index_record)); return -1; } diff --git a/src/lib-index/mail-index-map-read.c b/src/lib-index/mail-index-map-read.c index c73480a0ea..bf219320f4 100644 --- a/src/lib-index/mail-index-map-read.c +++ b/src/lib-index/mail-index-map-read.c @@ -67,7 +67,7 @@ static int mail_index_mmap(struct mail_index_map *map, uoff_t file_size) if (rec_map->mmap_size < MAIL_INDEX_HEADER_MIN_SIZE) { mail_index_set_error(index, "Corrupted index file %s: " - "File too small (%"PRIuSIZE_T")", + "File too small (%zu)", index->filepath, rec_map->mmap_size); return 0; } diff --git a/src/lib-index/mail-transaction-log-file.c b/src/lib-index/mail-transaction-log-file.c index 5bd5e338f6..220659af82 100644 --- a/src/lib-index/mail-transaction-log-file.c +++ b/src/lib-index/mail-transaction-log-file.c @@ -1741,9 +1741,9 @@ mail_transaction_log_file_mmap(struct mail_transaction_log_file *file, if (ioloop_time != file->last_mmap_error_time) { file->last_mmap_error_time = ioloop_time; log_file_set_syscall_error(file, t_strdup_printf( - "mmap(size=%"PRIuSIZE_T")", file->mmap_size)); + "mmap(size=%zu)", file->mmap_size)); } - *reason_r = t_strdup_printf("mmap(size=%"PRIuSIZE_T") failed: %m", + *reason_r = t_strdup_printf("mmap(size=%zu) failed: %m", file->mmap_size); file->mmap_size = 0; return -1; diff --git a/src/lib-index/mail-transaction-log-view.c b/src/lib-index/mail-transaction-log-view.c index f42d57fd63..ddf42440db 100644 --- a/src/lib-index/mail-transaction-log-view.c +++ b/src/lib-index/mail-transaction-log-view.c @@ -778,7 +778,7 @@ log_view_get_next(struct mail_transaction_log_view *view, if (view->cur_offset + sizeof(*hdr) > file_size) { mail_transaction_log_file_set_corrupted(file, "offset points outside file " - "(%"PRIuUOFF_T" + %"PRIuSIZE_T" > %"PRIuSIZE_T")", + "(%"PRIuUOFF_T" + %zu > %zu)", view->cur_offset, sizeof(*hdr), file_size); return -1; } @@ -800,7 +800,7 @@ log_view_get_next(struct mail_transaction_log_view *view, if (file_size - view->cur_offset < full_size) { mail_transaction_log_file_set_corrupted(file, "record size too large (type=0x%x, " - "offset=%"PRIuUOFF_T", size=%u, end=%"PRIuSIZE_T")", + "offset=%"PRIuUOFF_T", size=%u, end=%zu)", rec_type, view->cur_offset, full_size, file_size); return -1; } diff --git a/src/lib-master/master-service-haproxy.c b/src/lib-master/master-service-haproxy.c index f1a3bfdc3d..2affb8b704 100644 --- a/src/lib-master/master-service-haproxy.c +++ b/src/lib-master/master-service-haproxy.c @@ -213,7 +213,7 @@ master_service_haproxy_parse_ssl_tlv(struct master_service_haproxy_conn *hpconn, for(size_t i = 0; i < ssl_kv->len;) { struct haproxy_pp2_tlv kv; if (get_tlv(ssl_kv->data + i, ssl_kv->len - i, &kv) < 0) { - *error_r = t_strdup_printf("get_tlv(%"PRIuSIZE_T") failed:" + *error_r = t_strdup_printf("get_tlv(%zu) failed: " "Truncated data", i); return -1; } @@ -243,7 +243,7 @@ master_service_haproxy_parse_tlv(struct master_service_haproxy_conn *hpconn, struct haproxy_pp2_tlv_ssl ssl_kv; if (get_tlv(buf + i, blen - i, &kv) < 0) { - *error_r = t_strdup_printf("get_tlv(%"PRIuSIZE_T") failed:" + *error_r = t_strdup_printf("get_tlv(%zu) failed: " "Truncated data", i); return -1; } @@ -262,7 +262,7 @@ master_service_haproxy_parse_tlv(struct master_service_haproxy_conn *hpconn, break; case PP2_TYPE_SSL: if (get_ssl_tlv(kv.data, kv.len, &ssl_kv) < 0) { - *error_r = t_strdup_printf("get_ssl_tlv(%"PRIuSIZE_T") failed:" + *error_r = t_strdup_printf("get_ssl_tlv(%zu) failed: " "Truncated data", i); return -1; } @@ -375,7 +375,7 @@ master_service_haproxy_read(struct master_service_haproxy_conn *hpconn) if (ret < (ssize_t)size) { i_error("haproxy(v2): Client disconnected: " "Protocol payload length does not match header " - "(got=%"PRIuSIZE_T", expect=%"PRIuSIZE_T", rip=%s)", + "(got=%zu, expect=%zu, rip=%s)", (size_t)ret, size, net_ip2addr(real_remote_ip)); return -1; } diff --git a/src/lib-old-stats/stats-connection.c b/src/lib-old-stats/stats-connection.c index 5b79a44eac..24b5e73f40 100644 --- a/src/lib-old-stats/stats-connection.c +++ b/src/lib-old-stats/stats-connection.c @@ -85,7 +85,7 @@ int stats_connection_send(struct stats_connection *conn, const string_t *str) if (str_len(str) > PIPE_BUF && !pipe_warned) { i_warning("stats update sent more bytes that PIPE_BUF " - "(%"PRIuSIZE_T" > %u), this may break statistics", + "(%zu > %u), this may break statistics", str_len(str), (unsigned int)PIPE_BUF); pipe_warned = TRUE; } diff --git a/src/lib-smtp/smtp-client-command.c b/src/lib-smtp/smtp-client-command.c index cc2ed3ba55..80fb5bf352 100644 --- a/src/lib-smtp/smtp-client-command.c +++ b/src/lib-smtp/smtp-client-command.c @@ -1424,7 +1424,7 @@ _cmd_bdat_send_chunks(struct _cmd_data_context *ctx, cmd = ctx->cmd_data; smtp_client_command_set_stream(cmd, chunk, FALSE); i_stream_unref(&chunk); - smtp_client_command_printf(cmd, "BDAT %"PRIuSIZE_T" LAST", data_size); + smtp_client_command_printf(cmd, "BDAT %zu LAST", data_size); smtp_client_command_submit_after(cmd, cmd_prev); if (array_count(&ctx->cmds) == 0) { diff --git a/src/lib-smtp/smtp-client-connection.c b/src/lib-smtp/smtp-client-connection.c index c3ccf6e425..a8782b3bb2 100644 --- a/src/lib-smtp/smtp-client-connection.c +++ b/src/lib-smtp/smtp-client-connection.c @@ -1399,14 +1399,14 @@ smtp_client_connection_connected(struct connection *_conn, bool success) net_set_send_buffer_size(_conn->fd_out, set->socket_send_buffer_size) < 0) { e_error(conn->event, - "net_set_send_buffer_size(%"PRIuSIZE_T") failed: %m", + "net_set_send_buffer_size(%zu) failed: %m", set->socket_send_buffer_size); } if (set->socket_recv_buffer_size > 0 && net_set_recv_buffer_size(_conn->fd_in, set->socket_recv_buffer_size) < 0) { e_error(conn->event, - "net_set_recv_buffer_size(%"PRIuSIZE_T") failed: %m", + "net_set_recv_buffer_size(%zu) failed: %m", set->socket_recv_buffer_size); } diff --git a/src/lib-smtp/smtp-server-connection.c b/src/lib-smtp/smtp-server-connection.c index 8219184948..404acc888b 100644 --- a/src/lib-smtp/smtp-server-connection.c +++ b/src/lib-smtp/smtp-server-connection.c @@ -923,14 +923,14 @@ smtp_server_connection_alloc(struct smtp_server *server, net_set_send_buffer_size(fd_out, set->socket_send_buffer_size) < 0) { e_error(conn->event, - "net_set_send_buffer_size(%"PRIuSIZE_T") failed: %m", + "net_set_send_buffer_size(%zu) failed: %m", set->socket_send_buffer_size); } if (set->socket_recv_buffer_size > 0 && net_set_recv_buffer_size(fd_in, set->socket_recv_buffer_size) < 0) { e_error(conn->event, - "net_set_recv_buffer_size(%"PRIuSIZE_T") failed: %m", + "net_set_recv_buffer_size(%zu) failed: %m", set->socket_recv_buffer_size); } diff --git a/src/lib-smtp/test-smtp-payload.c b/src/lib-smtp/test-smtp-payload.c index 72a8464a61..38feb5bd27 100644 --- a/src/lib-smtp/test-smtp-payload.c +++ b/src/lib-smtp/test-smtp-payload.c @@ -240,7 +240,7 @@ client_transaction_read_more(struct client_transaction *ctrans) fsize = 0; i_fatal("test server: " "payload ended prematurely " - "(at least %"PRIuSIZE_T" bytes left)", fsize); + "(at least %zu bytes left)", fsize); } if (debug) { diff --git a/src/lib-ssl-iostream/dovecot-openssl-common.c b/src/lib-ssl-iostream/dovecot-openssl-common.c index d68d15ffb6..76f98bc9e7 100644 --- a/src/lib-ssl-iostream/dovecot-openssl-common.c +++ b/src/lib-ssl-iostream/dovecot-openssl-common.c @@ -22,7 +22,7 @@ static void *dovecot_openssl_malloc(size_t size) void *mem = malloc(size); if (mem == NULL) { i_fatal_status(FATAL_OUTOFMEM, - "OpenSSL: malloc(%"PRIuSIZE_T"): Out of memory", size); + "OpenSSL: malloc(%zu): Out of memory", size); } return mem; } @@ -36,7 +36,7 @@ static void *dovecot_openssl_realloc(void *ptr, size_t size) void *mem = realloc(ptr, size); if (mem == NULL) { i_fatal_status(FATAL_OUTOFMEM, - "OpenSSL: realloc(%"PRIuSIZE_T"): Out of memory", size); + "OpenSSL: realloc(%zu): Out of memory", size); } return mem; } diff --git a/src/lib-storage/index/dbox-common/dbox-file.c b/src/lib-storage/index/dbox-common/dbox-file.c index d861fb04ec..410b070bc3 100644 --- a/src/lib-storage/index/dbox-common/dbox-file.c +++ b/src/lib-storage/index/dbox-common/dbox-file.c @@ -360,7 +360,7 @@ int dbox_file_read_mail_header(struct dbox_file *file, uoff_t *physical_size_r) if (file->input->stream_errno == 0) { /* EOF, broken offset or file truncated */ dbox_file_set_corrupted(file, "EOF reading msg header " - "(got %"PRIuSIZE_T"/%u bytes)", + "(got %zu/%u bytes)", size, file->msg_header_size); return 0; } diff --git a/src/lib-storage/index/dbox-multi/mdbox-storage.c b/src/lib-storage/index/dbox-multi/mdbox-storage.c index e0cc706d9b..fbd4604449 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-storage.c +++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c @@ -217,7 +217,7 @@ int mdbox_read_header(struct mdbox_mailbox *mbox, if (data_size < MDBOX_INDEX_HEADER_MIN_SIZE && (!mbox->creating || data_size != 0)) { mailbox_set_critical(&mbox->box, - "mdbox: Invalid dbox header size: %"PRIuSIZE_T, + "mdbox: Invalid dbox header size: %zu", data_size); mdbox_storage_set_corrupted(mbox->storage); return -1; diff --git a/src/lib-storage/index/imapc/imapc-storage.c b/src/lib-storage/index/imapc/imapc-storage.c index d90ea66b33..2e758b129e 100644 --- a/src/lib-storage/index/imapc/imapc-storage.c +++ b/src/lib-storage/index/imapc/imapc-storage.c @@ -404,7 +404,7 @@ imapc_storage_create(struct mail_storage *_storage, /* serialize all the settings */ _storage->unique_root_dir = p_strdup_printf(_storage->pool, "%s%s://(%s|%s):%s@%s:%u/%s mechs:%s features:%s " - "rawlog:%s cmd_timeout:%u maxidle:%u maxline:%"PRIuSIZE_T"u " + "rawlog:%s cmd_timeout:%u maxidle:%u maxline:%zuu " "pop3delflg:%s root_dir:%s", storage->set->imapc_ssl, storage->set->imapc_ssl_verify ? "(verify)" : "", diff --git a/src/lib-storage/index/index-mailbox-size.c b/src/lib-storage/index/index-mailbox-size.c index 6a8259baa3..9c7651c6ef 100644 --- a/src/lib-storage/index/index-mailbox-size.c +++ b/src/lib-storage/index/index-mailbox-size.c @@ -73,7 +73,7 @@ static void vsize_header_refresh(struct mailbox_vsize_update *update) else { if (size != 0) { mailbox_set_critical(update->box, - "vsize-hdr has invalid size: %"PRIuSIZE_T, + "vsize-hdr has invalid size: %zu", size); } update->rebuild = TRUE; diff --git a/src/lib-storage/index/mbox/mbox-sync-rewrite.c b/src/lib-storage/index/mbox/mbox-sync-rewrite.c index cc34960064..d6c16e2825 100644 --- a/src/lib-storage/index/mbox/mbox-sync-rewrite.c +++ b/src/lib-storage/index/mbox/mbox-sync-rewrite.c @@ -434,7 +434,7 @@ static int mbox_sync_read_and_move(struct mbox_sync_context *sync_ctx, mbox_sync_set_critical(sync_ctx, "seq=%u uid=%u uid_broken=%d " "originally needed %"PRIuUOFF_T - " bytes, now needs %"PRIuSIZE_T" bytes", + " bytes, now needs %zu bytes", seq, mails[idx].uid, mails[idx].uid_broken ? 1 : 0, (uoff_t)-mails[idx].space, need_space); return -1; diff --git a/src/lib/buffer.c b/src/lib/buffer.c index f1883edb16..316771802b 100644 --- a/src/lib/buffer.c +++ b/src/lib/buffer.c @@ -46,10 +46,9 @@ buffer_check_limits(struct real_buffer *buf, size_t pos, size_t data_size) unsigned int extra; size_t new_size; - if (unlikely((size_t)-1 - pos < data_size)) { - i_panic("Buffer write out of range (%"PRIuSIZE_T - " + %"PRIuSIZE_T")", pos, data_size); - } + if (unlikely((size_t)-1 - pos < data_size)) + i_panic("Buffer write out of range (%zu + %zu)", pos, data_size); + new_size = pos + data_size; if (new_size > buf->used && buf->used < buf->dirty) { @@ -66,8 +65,8 @@ buffer_check_limits(struct real_buffer *buf, size_t pos, size_t data_size) extra = buf->dynamic ? 1 : 0; if (new_size + extra > buf->alloc) { if (unlikely(!buf->dynamic)) { - i_panic("Buffer full (%"PRIuSIZE_T" > %"PRIuSIZE_T", " - "pool %s)", pos + data_size, buf->alloc, + i_panic("Buffer full (%zu > %zu, pool %s)", + pos + data_size, buf->alloc, buf->pool == NULL ? "" : pool_get_name(buf->pool)); } diff --git a/src/lib/data-stack.c b/src/lib/data-stack.c index e102769c5e..82887991a4 100644 --- a/src/lib/data-stack.c +++ b/src/lib/data-stack.c @@ -355,8 +355,8 @@ static struct stack_block *mem_block_alloc(size_t min_size) return &outofmem_area.block; } outofmem = TRUE; - i_panic("data stack: Out of memory when allocating %" - PRIuSIZE_T" bytes", alloc_size + SIZEOF_MEMBLOCK); + i_panic("data stack: Out of memory when allocating %zu bytes", + alloc_size + SIZEOF_MEMBLOCK); } block->size = alloc_size; block->left = 0; @@ -380,7 +380,7 @@ static void *t_malloc_real(size_t size, bool permanent) #endif if (unlikely(size == 0 || size > SSIZE_T_MAX)) - i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size); + i_panic("Trying to allocate %zu bytes", size); if (unlikely(!data_stack_initialized)) { /* kludgy, but allow this before initialization */ @@ -474,7 +474,7 @@ bool t_try_realloc(void *mem, size_t size) unsigned char *after_last_alloc; if (unlikely(size == 0 || size > SSIZE_T_MAX)) - i_panic("Trying to allocate %"PRIuSIZE_T" bytes", size); + i_panic("Trying to allocate %zu bytes", size); block_canary_check(current_block); last_alloc_size = current_frame_block->last_alloc_size[frame_pos]; diff --git a/src/lib/iostream-temp.c b/src/lib/iostream-temp.c index 3e6db4fd98..11b9e6833c 100644 --- a/src/lib/iostream-temp.c +++ b/src/lib/iostream-temp.c @@ -388,7 +388,7 @@ struct istream *iostream_temp_finish(struct ostream **output, input = i_stream_create_from_data(tstream->buf->data, tstream->buf->used); i_stream_set_name(input, t_strdup_printf( - "(Temp buffer in %s%s, %"PRIuSIZE_T" bytes)", + "(Temp buffer in %s%s, %zu bytes)", tstream->temp_path_prefix, for_path, tstream->buf->used)); i_stream_add_destroy_callback(input, iostream_temp_buf_destroyed, tstream->buf); diff --git a/src/lib/istream-file.c b/src/lib/istream-file.c index 9989eaac02..e89e9d46d7 100644 --- a/src/lib/istream-file.c +++ b/src/lib/istream-file.c @@ -89,12 +89,11 @@ ssize_t i_stream_file_read(struct istream_private *stream) i_assert(errno != EBADF); if (fstream->file) { io_stream_set_error(&stream->iostream, - "pread(size=%"PRIuSIZE_T - " offset=%"PRIuUOFF_T") failed: %m", + "pread(size=%zu offset=%"PRIuUOFF_T") failed: %m", size, offset); } else { io_stream_set_error(&stream->iostream, - "read(size=%"PRIuSIZE_T") failed: %m", + "read(size=%zu) failed: %m", size); } stream->istream.stream_errno = errno; diff --git a/src/lib/istream.c b/src/lib/istream.c index 2c71f1dbf0..771079d30c 100644 --- a/src/lib/istream.c +++ b/src/lib/istream.c @@ -629,7 +629,7 @@ char *i_stream_read_next_line(struct istream *stream) switch (i_stream_read(stream)) { case -2: io_stream_set_error(&stream->real_stream->iostream, - "Line is too long (over %"PRIuSIZE_T + "Line is too long (over %zu" " bytes at offset %"PRIuUOFF_T")", i_stream_get_data_size(stream), stream->v_offset); stream->stream_errno = errno = ENOBUFS; diff --git a/src/lib/malloc-overflow.h b/src/lib/malloc-overflow.h index 590e6585cc..108cc00ac0 100644 --- a/src/lib/malloc-overflow.h +++ b/src/lib/malloc-overflow.h @@ -15,8 +15,8 @@ malloc_multiply_check(size_t a, size_t b, size_t sizeof_a, size_t sizeof_b, if-check for types that are small enough to never wrap size_t. */ if ((sizeof_a * 2 > sizeof(size_t) || sizeof_b * 2 > sizeof(size_t)) && b != 0 && (a > SIZE_MAX / b)) { - i_panic("file %s: line %d: memory allocation overflow: " - "%" PRIuSIZE_T" * %" PRIuSIZE_T, fname, linenum, a, b); + i_panic("file %s: line %d: memory allocation overflow: %zu * %zu", + fname, linenum, a, b); } return a * b; } @@ -37,8 +37,8 @@ malloc_add_check(size_t a, size_t b, size_t sizeof_a, size_t sizeof_b, if-check for types that are small enough to never wrap size_t. */ if ((sizeof_a >= sizeof(size_t) || sizeof_b >= sizeof(size_t)) && SIZE_MAX - a < b) { - i_panic("file %s: line %d: memory allocation overflow: " - "%" PRIuSIZE_T" + %" PRIuSIZE_T, fname, linenum, a, b); + i_panic("file %s: line %d: memory allocation overflow: %zu + %zu", + fname, linenum, a, b); } return a + b; } diff --git a/src/lib/mempool-allocfree.c b/src/lib/mempool-allocfree.c index 4b3d3b71f5..239f984be1 100644 --- a/src/lib/mempool-allocfree.c +++ b/src/lib/mempool-allocfree.c @@ -152,7 +152,7 @@ pool_t pool_allocfree_create(const char *name ATTR_UNUSED) pool = calloc(1, SIZEOF_ALLOCFREE_POOL); if (pool == NULL) - i_fatal_status(FATAL_OUTOFMEM, "calloc(1, %"PRIuSIZE_T"): Out of memory", + i_fatal_status(FATAL_OUTOFMEM, "calloc(1, %zu): Out of memory", SIZEOF_ALLOCFREE_POOL); #ifdef DEBUG pool->name = strdup(name); @@ -257,7 +257,7 @@ static void *pool_allocfree_malloc(pool_t pool, size_t size) struct pool_block *block = calloc(1, SIZEOF_POOLBLOCK + size); if (block == NULL) - i_fatal_status(FATAL_OUTOFMEM, "calloc(1, %"PRIuSIZE_T"): Out of memory", + i_fatal_status(FATAL_OUTOFMEM, "calloc(1, %zu): Out of memory", SIZEOF_POOLBLOCK + size); block->size = size; return pool_block_attach(apool, block); @@ -282,7 +282,7 @@ static void *pool_allocfree_realloc(pool_t pool, void *mem, struct pool_block *block = pool_block_detach(apool, mem); if ((new_mem = realloc(block, SIZEOF_POOLBLOCK+new_size)) == NULL) - i_fatal_status(FATAL_OUTOFMEM, "realloc(block, %"PRIuSIZE_T")", + i_fatal_status(FATAL_OUTOFMEM, "realloc(block, %zu)", SIZEOF_POOLBLOCK+new_size); /* zero out new memory */ diff --git a/src/lib/mempool-alloconly.c b/src/lib/mempool-alloconly.c index c6673b3b4f..f037dd1235 100644 --- a/src/lib/mempool-alloconly.c +++ b/src/lib/mempool-alloconly.c @@ -359,7 +359,7 @@ static void block_alloc(struct alloconly_pool *apool, size_t size) stack, so make sure everything is allocated before calling it. */ t_buffer_alloc_last_full(); - i_debug("Growing pool '%s' with: %"PRIuSIZE_T, + i_debug("Growing pool '%s' with: %zu", apool->name, size); } #endif @@ -367,7 +367,7 @@ static void block_alloc(struct alloconly_pool *apool, size_t size) block = calloc(size, 1); if (unlikely(block == NULL)) { - i_fatal_status(FATAL_OUTOFMEM, "block_alloc(%"PRIuSIZE_T + i_fatal_status(FATAL_OUTOFMEM, "block_alloc(%zu" "): Out of memory", size); } block->prev = apool->block; diff --git a/src/lib/mempool-system.c b/src/lib/mempool-system.c index 06e0bcbe8c..51ea7e34f8 100644 --- a/src/lib/mempool-system.c +++ b/src/lib/mempool-system.c @@ -104,8 +104,8 @@ static void *pool_system_malloc(pool_t pool ATTR_UNUSED, size_t size) mem = calloc(size, 1); if (unlikely(mem == NULL)) { - i_fatal_status(FATAL_OUTOFMEM, "pool_system_malloc(%"PRIuSIZE_T - "): Out of memory", size); + i_fatal_status(FATAL_OUTOFMEM, "pool_system_malloc(%zu): " + "Out of memory", size); } #ifdef DEBUG /* we rely on errno not changing. it shouldn't. */ @@ -139,8 +139,8 @@ static void *pool_system_realloc(pool_t pool ATTR_UNUSED, void *mem, mem = realloc(mem, new_size); if (unlikely(mem == NULL)) { - i_fatal_status(FATAL_OUTOFMEM, "pool_system_realloc(%"PRIuSIZE_T - "): Out of memory", new_size); + i_fatal_status(FATAL_OUTOFMEM, "pool_system_realloc(%zu): " + "Out of memory", new_size); } if (old_size < new_size) { diff --git a/src/lib/mempool.h b/src/lib/mempool.h index 12ce2210ae..9c7aca0581 100644 --- a/src/lib/mempool.h +++ b/src/lib/mempool.h @@ -102,7 +102,7 @@ static inline void * ATTR_MALLOC ATTR_RETURNS_NONNULL p_malloc(pool_t pool, size_t size) { if (unlikely(size == 0 || size > POOL_MAX_ALLOC_SIZE)) - i_panic("Trying to allocate %" PRIuSIZE_T " bytes", size); + i_panic("Trying to allocate %zu bytes", size); return pool->v->malloc(pool, size); } @@ -111,7 +111,7 @@ static inline void * ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL p_realloc(pool_t pool, void *mem, size_t old_size, size_t new_size) { if (unlikely(new_size == 0 || new_size > POOL_MAX_ALLOC_SIZE)) - i_panic("Trying to reallocate %" PRIuSIZE_T " -> %" PRIuSIZE_T " bytes", + i_panic("Trying to reallocate %zu -> %zu bytes", old_size, new_size); if (mem == NULL) diff --git a/src/lib/ostream.c b/src/lib/ostream.c index 594bebc89e..b77ee278cc 100644 --- a/src/lib/ostream.c +++ b/src/lib/ostream.c @@ -191,7 +191,7 @@ int o_stream_flush(struct ostream *stream) if (unlikely(_stream->noverflow)) { io_stream_set_error(&_stream->iostream, - "Output stream buffer was full (%"PRIuSIZE_T" bytes)", + "Output stream buffer was full (%zu bytes)", o_stream_get_max_buffer_size(stream)); errno = stream->stream_errno = ENOBUFS; return -1; diff --git a/src/lib/test-base64.c b/src/lib/test-base64.c index 8175c66dcc..8ac6329415 100644 --- a/src/lib/test-base64.c +++ b/src/lib/test-base64.c @@ -1101,7 +1101,7 @@ test_base64_random_lowlevel_case(const struct base64_scheme *b64, if (test_has_failed()) { i_info("One block test failed (" "enc_flags=%02x dec_flags=%02x " - "max_line_len=%"PRIuSIZE_T" size=%"PRIuSIZE_T")", + "max_line_len=%zu size=%zu)", enc_flags, dec_flags, max_line_len, in_buf_size); return; @@ -1122,7 +1122,7 @@ test_base64_random_lowlevel_case(const struct base64_scheme *b64, if (test_has_failed()) { i_info("Streaming single-byte trickle test failed (" "enc_flags=%02x dec_flags=%02x " - "max_line_len=%"PRIuSIZE_T" size=%"PRIuSIZE_T")", + "max_line_len=%zu size=%zu)", enc_flags, dec_flags, max_line_len, in_buf_size); return; @@ -1142,7 +1142,7 @@ test_base64_random_lowlevel_case(const struct base64_scheme *b64, if (test_has_failed()) { i_info("Streaming random chunks test failed (" "enc_flags=%02x dec_flags=%02x " - "max_line_len=%"PRIuSIZE_T" size=%"PRIuSIZE_T")", + "max_line_len=%zu size=%zu)", enc_flags, dec_flags, max_line_len, in_buf_size); return; diff --git a/src/lib/test-istream-base64-decoder.c b/src/lib/test-istream-base64-decoder.c index 36280293d3..188e3e581e 100644 --- a/src/lib/test-istream-base64-decoder.c +++ b/src/lib/test-istream-base64-decoder.c @@ -291,7 +291,7 @@ test_istream_base64_io_random(void) } if (test_has_failed()) { - i_info("Test parameters: size=%"PRIuSIZE_T" " + i_info("Test parameters: size=%zu " "line_length_1=%u line_length_2=%u", in_buf_size, chpl1, chpl2); } diff --git a/src/lib/test-malloc-overflow.c b/src/lib/test-malloc-overflow.c index 6b7ae7fca9..ceb48bb247 100644 --- a/src/lib/test-malloc-overflow.c +++ b/src/lib/test-malloc-overflow.c @@ -59,10 +59,10 @@ static enum fatal_test_state fatal_malloc_overflow_multiply(unsigned int *stage) switch (*stage) { case 0: test_begin("MALLOC_MULTIPLY() overflows"); - i_error("%"PRIuSIZE_T, MALLOC_MULTIPLY((size_t)SIZE_MAX/2, (uint8_t)3)); + i_error("%zu", MALLOC_MULTIPLY((size_t)SIZE_MAX/2, (uint8_t)3)); break; case 1: - i_error("%"PRIuSIZE_T, MALLOC_MULTIPLY((uint8_t)3, (size_t)SIZE_MAX/2)); + i_error("%zu", MALLOC_MULTIPLY((uint8_t)3, (size_t)SIZE_MAX/2)); break; } *stage -= 2; @@ -77,9 +77,9 @@ static enum fatal_test_state fatal_malloc_overflow_multiply(unsigned int *stage) i = *stage / 2; if (*stage % 2 == 0) - i_error("%"PRIuSIZE_T, MALLOC_MULTIPLY(mul_tests[i].a, mul_tests[i].b)); + i_error("%zu", MALLOC_MULTIPLY(mul_tests[i].a, mul_tests[i].b)); else - i_error("%"PRIuSIZE_T, MALLOC_MULTIPLY(mul_tests[i].b, mul_tests[i].a)); + i_error("%zu", MALLOC_MULTIPLY(mul_tests[i].b, mul_tests[i].a)); return FATAL_TEST_FAILURE; } @@ -97,10 +97,10 @@ static enum fatal_test_state fatal_malloc_overflow_add(unsigned int *stage) switch (*stage) { case 0: test_begin("MALLOC_ADD() overflows"); - i_error("%"PRIuSIZE_T, MALLOC_ADD((size_t)SIZE_MAX, (uint8_t)1)); + i_error("%zu", MALLOC_ADD((size_t)SIZE_MAX, (uint8_t)1)); break; case 1: - i_error("%"PRIuSIZE_T, MALLOC_ADD((uint8_t)1, (size_t)SIZE_MAX)); + i_error("%zu", MALLOC_ADD((uint8_t)1, (size_t)SIZE_MAX)); break; } *stage -= 2; @@ -115,9 +115,9 @@ static enum fatal_test_state fatal_malloc_overflow_add(unsigned int *stage) i = *stage / 2; if (*stage % 2 == 0) - i_error("%"PRIuSIZE_T, MALLOC_ADD(add_tests[i].a, add_tests[i].b)); + i_error("%zu", MALLOC_ADD(add_tests[i].a, add_tests[i].b)); else - i_error("%"PRIuSIZE_T, MALLOC_ADD(add_tests[i].b, add_tests[i].a)); + i_error("%zu", MALLOC_ADD(add_tests[i].b, add_tests[i].a)); return FATAL_TEST_FAILURE; } diff --git a/src/login-common/login-proxy.c b/src/login-common/login-proxy.c index 1888060731..1d46a65c3c 100644 --- a/src/login-common/login-proxy.c +++ b/src/login-common/login-proxy.c @@ -114,7 +114,7 @@ static void login_proxy_free_errstr(struct login_proxy **_proxy, (int)(ioloop_time - proxy_last_io(proxy)), proxy->server_output->offset, proxy->client_output->offset); if (o_stream_get_buffer_used_size(proxy->client_output) > 0) { - str_printfa(reason, "+%"PRIuSIZE_T, + str_printfa(reason, "+%zu", o_stream_get_buffer_used_size(proxy->client_output)); } if (iostream_proxy_is_waiting_output(proxy->iostream_proxy, diff --git a/src/plugins/fts/fts-expunge-log.c b/src/plugins/fts/fts-expunge-log.c index 4409585141..bcb9d40f36 100644 --- a/src/plugins/fts/fts-expunge-log.c +++ b/src/plugins/fts/fts-expunge-log.c @@ -429,7 +429,7 @@ fts_expunge_log_read_failure(struct fts_expunge_log_read_ctx *ctx, size = i_stream_get_data_size(ctx->input); ctx->corrupted = TRUE; i_error("Corrupted fts expunge log %s: " - "Unexpected EOF (read %"PRIuSIZE_T" / %u bytes)", + "Unexpected EOF (read %zu / %u bytes)", ctx->log->path, size, wanted_size); } } diff --git a/src/plugins/mail-filter/ostream-ext-filter.c b/src/plugins/mail-filter/ostream-ext-filter.c index b8c3bfc299..6e8481e5e8 100644 --- a/src/plugins/mail-filter/ostream-ext-filter.c +++ b/src/plugins/mail-filter/ostream-ext-filter.c @@ -163,7 +163,7 @@ static int filter_connect(struct mail_filter_ostream *mstream, mstream->ext_out->stream_errno; } else if ((size_t)ret != str_len(str)) { io_stream_set_error(&mstream->ostream.iostream, - "write(%s): Wrote only %"PRIuSIZE_T" of %"PRIuSIZE_T" bytes", + "write(%s): Wrote only %zu of %zu bytes", socket_path, (size_t)ret, str_len(str)); mstream->ostream.ostream.stream_errno = ENOBUFS; } diff --git a/src/plugins/var-expand-crypt/var-expand-crypt-plugin.c b/src/plugins/var-expand-crypt/var-expand-crypt-plugin.c index 53ec885384..75ba350a17 100644 --- a/src/plugins/var-expand-crypt/var-expand-crypt-plugin.c +++ b/src/plugins/var-expand-crypt/var-expand-crypt-plugin.c @@ -111,7 +111,7 @@ var_expand_crypt(struct dcrypt_context_symmetric *dctx, buffer_t *key, buffer_t /* acquire IV */ dcrypt_ctx_sym_get_iv(dctx, iv); } else if (dcrypt_ctx_sym_get_iv_length(dctx) != iv->used) { - *error_r = t_strdup_printf("crypt: IV length invalid (%"PRIuSIZE_T" != %u)", + *error_r = t_strdup_printf("crypt: IV length invalid (%zu != %u)", iv->used, dcrypt_ctx_sym_get_iv_length(dctx)); return -1; @@ -120,7 +120,7 @@ var_expand_crypt(struct dcrypt_context_symmetric *dctx, buffer_t *key, buffer_t } if (dcrypt_ctx_sym_get_key_length(dctx) != key->used) { - *error_r = t_strdup_printf("crypt: Key length invalid (%"PRIuSIZE_T" != %u)", + *error_r = t_strdup_printf("crypt: Key length invalid (%zu != %u)", key->used, dcrypt_ctx_sym_get_key_length(dctx)); return -1; diff --git a/src/submission-login/client-authenticate.c b/src/submission-login/client-authenticate.c index 3b2680a520..f61384f297 100644 --- a/src/submission-login/client-authenticate.c +++ b/src/submission-login/client-authenticate.c @@ -61,7 +61,7 @@ static void cmd_helo_reply(struct submission_client *subm_client, if (subm_client->set->submission_max_mail_size > 0) { smtp_server_reply_ehlo_add_param(reply, - "SIZE", "%"PRIuSIZE_T, + "SIZE", "%zu", subm_client->set->submission_max_mail_size); } else { smtp_server_reply_ehlo_add(reply, "SIZE");