Skip to contentSkip to conversation

Fix errors when building with -Werror=format-security gcc option

PATCH Applied Herton Ronaldo Krzesinski 2 participants 2 messages Feb 10, 2009 – Feb 11, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix errors when building with -Werror=format-security gcc option

---
 src/ksyms.c           |    2 +-
 src/setfont.c         |    2 +-
 src/setmetamode.c     |    2 +-
 src/showconsolefont.c |    4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)
src/ksyms.c +1 -1
index a322f70..35fed29 100644
@@ -1662,7 +1662,7 @@ list_charsets(FILE *f) {
 			if(!strncmp(charsets[i].charset, mm[j], lth)) {
 				if(ct++)
 					fprintf(f, ",");
-				fprintf(f, charsets[i].charset+lth);
+				fprintf(f, "%s", charsets[i].charset+lth);
 			}
 		}
 		fprintf(f, "}");
src/setfont.c +1 -1
index af3805a..b979cb7 100644
@@ -725,7 +725,7 @@ saveoldfontplusunicodemap(int fd, char *Ofil) {
 static void
 send_escseq(int fd, char *seq, int n) {
 	if (write(fd, seq, n) != n)  /* maybe fd is read-only */
-		printf(seq);
+		printf("%s", seq);
 }
 
 void
src/setmetamode.c +1 -1
index 4b4aab2..ecbaaa3 100644
@@ -41,7 +41,7 @@ report(int meta) {
       default:
 	s = _("Strange mode for Meta key?\n");
     }
-    printf(s);
+    printf("%s", s);
 }
 
 struct meta {
src/showconsolefont.c +2 -2
index 091bc3b..1ccb81b 100644
@@ -188,9 +188,9 @@ main (int argc, char **argv) {
 		printf("    ");
 		for(j=0; j < cols && i+j*rows < n; j++) {
 			putchar(BASE + (i%nr)*cols+j);
-			printf(sep);
+			printf("%s", sep);
 			if (j%8 == 7)
-				printf(sep);
+				printf("%s", sep);
 		}
 		putchar('\n');
 		if (i%8 == 7)
Signature · 1 line
1.6.1.3