From 19938cfb79f2e1d62e05d5e0d0e48c538e459fb5 Mon Sep 17 00:00:00 2001 From: Milos Liska Date: Wed, 17 Oct 2018 19:32:42 +0200 Subject: [PATCH] Trivial compilation warning fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/control_socket.cpp: In function ‘void* control_thread(void*)’: src/control_socket.cpp:574:44: warning: ‘%s’ directive output may be truncated writing up to 1023 bytes into a region of size 1009 [-Wformat-truncation=] snprintf(buf, sizeof(buf), "(unknown path: %s)", path); ^~~~~~~~~~~~~~~~~~~~ ~~~~ src/control_socket.cpp:574:25: note: ‘snprintf’ output between 17 and 1040 bytes into a destination of size 1024 snprintf(buf, sizeof(buf), "(unknown path: %s)", path); --- src/control_socket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/control_socket.cpp b/src/control_socket.cpp index bd23b515b..03247a602 100644 --- a/src/control_socket.cpp +++ b/src/control_socket.cpp @@ -289,7 +289,7 @@ static int process_msg(struct control_state *s, fd_t client_fd, char *message, s char path[1024] = ""; // path for msg receiver (usually video) char path_audio[1024] = ""; // auxiliary buffer used when we need to signalize both audio // and video - char buf[1024]; + char buf[1048]; if(prefix_matches(message, "port ")) { message = suffix(message, "port ");