[Sheepdog] [PATCH 05/12] use a string literal for printf formatting

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Fri May 21 13:42:32 CEST 2010


It is not safe to use a variable for printf formatting.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 collie/treeview.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/collie/treeview.c b/collie/treeview.c
index 2f21dd7..556964d 100644
--- a/collie/treeview.c
+++ b/collie/treeview.c
@@ -153,7 +153,7 @@ static void _dump_tree(struct vdi_tree *current, int level, int first, int last)
 	if (current->highlight)
 		printf(TEXT_BOLD);
 
-	printf(current->label);
+	printf("%s", current->label);
 
 	if (current->highlight)
 		printf(TEXT_NORMAL);
@@ -190,7 +190,7 @@ void dump_tree(void)
 	}
 
 	list_for_each_entry(vdi, &root->children, siblings) {
-		printf(vdi->name);
+		printf("%s", vdi->name);
 		more[0] = 0;
 		width[0] = strlen(vdi->name);
 		_dump_tree(vdi, 1, 1, 1);
-- 
1.5.6.5




More information about the sheepdog mailing list