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));
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);
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",
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);
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));
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));
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);
}
return 0;
if (ret != sizeof(rec)) {
- i_fatal("rec read() %"PRIuSIZE_T" != %"PRIuSIZE_T,
+ i_fatal("rec read() %zu != %zu",
ret, sizeof(rec));
}
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");
}
!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;
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");
}
if (test_has_failed()) {
- i_info("Test parameters: size=%"PRIuSIZE_T,
+ i_info("Test parameters: size=%zu",
in_buf_size);
}
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;
}
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:
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;
}
}
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;
}
/* 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;
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);
}
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));
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);
}
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]",
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]",
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" :
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;
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;
}
{
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);
}
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;
}
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;
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;
}
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) {
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;
/* 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;
}
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;
}
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;
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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) {
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);
}
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);
}
fsize = 0;
i_fatal("test server: "
"payload ended prematurely "
- "(at least %"PRIuSIZE_T" bytes left)", fsize);
+ "(at least %zu bytes left)", fsize);
}
if (debug) {
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;
}
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;
}
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;
}
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;
/* 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)" : "",
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;
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;
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) {
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 ? "<none>" :
pool_get_name(buf->pool));
}
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;
#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 */
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];
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);
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;
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;
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;
}
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;
}
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);
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);
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 */
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
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;
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. */
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) {
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);
}
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)
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;
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;
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;
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;
}
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);
}
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;
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;
}
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;
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;
}
(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,
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);
}
}
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;
}
/* 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;
}
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;
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");