From db9b8d6a2980777ee3f09b2e74905c8eed1be2cc Mon Sep 17 00:00:00 2001 From: Tom Russo Date: Sat, 8 Jun 2024 17:28:34 -0600 Subject: [PATCH] Fix clang warning regarding printf In tube.c, a use of "printf(helpstr)" was flagged by clang as potentially insecure. The insecurity of this is probably insignificant, but fixing it removes a warning from compilation. The warning is: src/tube.c:303:24: warning: format string is not a string literal (potentially insecure) [-Wformat-security] 303 | printf(helpStr); | ^~~~~~~ src/tube.c:303:24: note: treat the string as an argument to avoid this 303 | printf(helpStr); | ^ All that need be done is to provide a format string that is a string literal, with helpStr being the string to print instead of the format string. --- src/tube.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tube.c b/src/tube.c index 424cf17..be0a586 100755 --- a/src/tube.c +++ b/src/tube.c @@ -300,7 +300,7 @@ void tube_init(int argc, char* argv[]) } if ((strcmp(argv[firstArg],"-h") == 0) || (strcmp(argv[firstArg],"--help") == 0)){ - printf(helpStr); + printf("%s",helpStr); exit(0); }