connection: Fix wrong format string

Prevents undefined behavior if there is not enough space in the buffer
for a queued message.

Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
This commit is contained in:
Demi Marie Obenour 2024-08-05 12:59:21 -04:00
parent 290c36bc50
commit 9cb3d7aa9d

View file

@ -260,7 +260,7 @@ ring_buffer_ensure_space(struct wl_ring_buffer *b, size_t count)
* allowed).
*/
if (net_size > size_pot(size_bits)) {
wl_log("Data too big for buffer (%d + %zd > %zd).\n",
wl_log("Data too big for buffer (%zu + %zu > %zu).\n",
ring_buffer_size(b), count, size_pot(size_bits));
errno = E2BIG;
return -1;