From 34909d3887a7ac3f423f00ec0913a2da6447e374 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 6 Feb 2012 16:30:52 +0800 Subject: fixes format-security warnings --- src/storage/tag_utility.cpp | 2 +- tests/storage/test_parser.cpp | 2 +- tests/storage/test_parser2.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage/tag_utility.cpp b/src/storage/tag_utility.cpp index 2f4626a..e38810d 100644 --- a/src/storage/tag_utility.cpp +++ b/src/storage/tag_utility.cpp @@ -143,7 +143,7 @@ static gchar ** split_line(const gchar * line){ gchar * tmp = g_strndup( begin, cur - begin); /* TODO: switch to own strdup_escape implementation for \"->" transforming. */ - token = g_strdup_printf(tmp); + token = g_strdup_printf("%s", tmp); g_free(tmp); } else { /* handles other tokens. */ diff --git a/tests/storage/test_parser.cpp b/tests/storage/test_parser.cpp index a0045e6..7f10d78 100644 --- a/tests/storage/test_parser.cpp +++ b/tests/storage/test_parser.cpp @@ -57,7 +57,7 @@ static const char *help_msg = " zy-et26\n"; void print_help(){ - printf(help_msg); + printf("%s", help_msg); } int main (int argc, char * argv []) diff --git a/tests/storage/test_parser2.cpp b/tests/storage/test_parser2.cpp index 276a3a9..7c7058c 100644 --- a/tests/storage/test_parser2.cpp +++ b/tests/storage/test_parser2.cpp @@ -48,7 +48,7 @@ static const char * help_msg = void print_help(){ - printf(help_msg); + printf("%s", help_msg); } int main(int argc, char * argv[]) { -- cgit