From e698736901e381e4f0a0c5e7ab88701c8907460e Mon Sep 17 00:00:00 2001 From: talyz Date: Tue, 27 Jul 2021 20:55:54 +0200 Subject: [PATCH] Fix printf security compilation warning/error Fix the following GCC compilation error when the -Wformat-security and -Werror=format-security flags are used: main.c: In function 'info_msg': main.c:97:3: error: format not a string literal and no format arguments [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat-security-Werror=format-security8;;] 97 | printf(msg); | ^~~~~~ --- mds4dc/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mds4dc/src/main.c b/mds4dc/src/main.c index 73b5487..09a4d49 100644 --- a/mds4dc/src/main.c +++ b/mds4dc/src/main.c @@ -94,7 +94,7 @@ void info_msg(char* msg) { textColor(LIGHT_GRAY); } else { textColor(WHITE); - printf(msg); + printf("%s", msg); textColor(LIGHT_GRAY); } }