From 9c4b5c493161780b301877de6f96316ecf9b4e93 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Wed, 13 Nov 2019 11:40:26 +0200 Subject: [PATCH] compositor: Fix some warning when passing debugoptimized to meson MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Increase the buf size such it can accomodate sufficiently large local buffers. Spotted whilst looking for something else. ../compositor/main.c:157:22: warning: ‘%s’ directive output may be truncated writing up to 511 bytes into a region of size 128 [-Wformat-truncation=] 157 | snprintf(buf, len, "%s[%s.%03li]", datestr, | ^~ ~~~~~~~ ../compositor/main.c:157:21: note: directive argument in the range [-9223372036854775, 9223372036854775] 157 | snprintf(buf, len, "%s[%s.%03li]", datestr, | ^~~~~~~~~~~~~~ ../compositor/main.c:157:2: note: ‘snprintf’ output between 7 and 659 bytes into a destination of size 128 157 | snprintf(buf, len, "%s[%s.%03li]", datestr, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 158 | timestr, (tv.tv_usec / 1000)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Marius Vlad --- compositor/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compositor/main.c b/compositor/main.c index 29a427b9..22ac8b23 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -163,7 +163,7 @@ weston_log_timestamp(char *buf, size_t len) static void custom_handler(const char *fmt, va_list arg) { - char timestr[128]; + char timestr[512]; weston_log_scope_printf(log_scope, "%s libwayland: ", weston_log_timestamp(timestr,