[Pkg-lirc-maint] [PATCH 01/13] lircd: fix FTBS with -Werror=format-security enabled

Stefan Lippers-Hollmann s.l-h at gmx.de
Fri Dec 12 23:00:04 UTC 2014


gcc -DHAVE_CONFIG_H -I. -I..  -I.. -I../lib -Wall -Wp,-D_FORTIFY_SOURCE=2 -D_FORTIFY_SOURCE=2 -DSIM_SEND -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security  -c -o lircd_simsend-lircd.o `test -f 'lircd.c' || echo './'`lircd.c
lircd.c: In function 'lircd_parse_options':
lircd.c:2269:4: error: format not a string literal and no format arguments [-Werror=format-security]
    printf(help);
    ^
lircd.c: In function 'main':
lircd.c:2417:5: error: format not a string literal and no format arguments [-Werror=format-security]
     fprintf(stderr, errmsg);
     ^

Signed-off-by: Stefan Lippers-Hollmann <s.l-h at gmx.de>
---
 daemons/lircd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/daemons/lircd.c b/daemons/lircd.c
index 3a7f744..45ac1e6 100644
--- a/daemons/lircd.c
+++ b/daemons/lircd.c
@@ -2266,7 +2266,7 @@ static void lircd_parse_options(int argc, char** const argv)
 	{
 		switch (c) {
 		case 'h':
-			printf(help);
+			printf("%s", help);
 			exit(EXIT_SUCCESS);
 		case 'v':
 			printf("lircd %s\n", VERSION);
@@ -2414,7 +2414,7 @@ int main(int argc, char **argv)
 		opt = options_getstring("lircd:listen_hostport");
 		if (opt){
 			if (opt2host_port(opt, &address, &port, errmsg) != 0){
-				fprintf(stderr, errmsg);
+				fprintf(stderr, "%s", errmsg);
 				return(EXIT_FAILURE);
 			}
 		} else
-- 
2.1.3




More information about the Pkg-lirc-maint mailing list