From 56bff2f7181f1b51132f1f06682010900720cff9 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 24 May 2020 21:11:21 +0200 Subject: [PATCH] Avoid compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The field lock_video_orientation may only take values between -1 and 3 (included). But the compiler may trigger a warning on the sprintf() call, because its type could represent values which could overflow the string (like "-128"): > warning: ā€˜%iā€™ directive writing between 1 and 4 bytes into a region of > size 3 [-Wformat-overflow=] Increase the buffer size to remove the warning. --- app/src/server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/server.c b/app/src/server.c index 94881e51..fa9230e0 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -234,7 +234,7 @@ execute_server(struct server *server, const struct server_params *params) { char max_size_string[6]; char bit_rate_string[11]; char max_fps_string[6]; - char lock_video_orientation_string[3]; + char lock_video_orientation_string[5]; char display_id_string[6]; sprintf(max_size_string, "%"PRIu16, params->max_size); sprintf(bit_rate_string, "%"PRIu32, params->bit_rate);