Skip to contentSkip to conversation

xfsprogs: fix warning in libxcmd/input.c

PATCH Ben Myers 2 participants 2 messages Feb 1, 2013

lore
Share & tools
lore

Ben Myers

author
#0 lore raw

Fix an error when building with -Werror=format-security.

input.c: In function 'fetchline':
input.c:91:2: error: format not a string literal and no format arguments [-Werror=format-security]

Reported by: Arkadiusz Miśkiewicz <[email protected]>
Index: xfsprogs/libxcmd/input.c
===================================================================

libxcmd/input.c +1 -1
@@ -88,7 +88,7 @@
 
 	if (!line)
 		return NULL;
-	printf(get_prompt());
+	printf("%s", get_prompt());
 	fflush(stdout);
 	if (!fgets(line, MAXREADLINESZ, stdin)) {
 		free(line);

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by
#1 lore raw
Quoted 21 lines · Ben Myers

Fix an error when building with -Werror=format-security.

input.c: In function 'fetchline':
input.c:91:2: error: format not a string literal and no format arguments [-Werror=format-security]

Reported by: Arkadiusz Miśkiewicz<[email protected]>
Index: xfsprogs/libxcmd/input.c
===================================================================

libxcmd/input.c +1 -1
@@ -88,7 +88,7 @@
 
  	if (!line)
  		return NULL;
-	printf(get_prompt());
+	printf("%s", get_prompt());
  	fflush(stdout);
  	if (!fgets(line, MAXREADLINESZ, stdin)) {
  		free(line);
Quoted 4 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Looks good.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs