From 2f0bf2d0af5b9b749e6e195829fb7093fc8ab930 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 18 Dec 2009 08:45:12 +0000 Subject: Fix compiler warnings "format not a string literal and no format arguments". Actually exposed a bug in luaresume.cc --- server/src/saxparser.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/src/saxparser.cc') diff --git a/server/src/saxparser.cc b/server/src/saxparser.cc index 2018645..b5fb812 100644 --- a/server/src/saxparser.cc +++ b/server/src/saxparser.cc @@ -262,7 +262,7 @@ TEST_BEGIN; FILE *fp = fopen(XMLFILE, "w"); TEST_NOTEQUAL(fp, NULL, "Test if file \""XMLFILE"\" could be written."); if(!fp) TEST_FATAL("Could not write "XMLFILE); -fprintf(fp, xml); +fprintf(fp, "%s", xml); fclose(fp); TEST_MSG("Test callback parser."); @@ -295,8 +295,8 @@ for(size_t sz = 1; sz < 1000; sz++) { fp = fopen(XMLFILE, "w"); TEST_NOTEQUAL(fp, NULL, "Test if file \""XMLFILE"\" could be written."); if(!fp) TEST_FATAL("Could not write "XMLFILE); -fprintf(fp, xml_notrailingwhitespace); -fprintf(fp, xml_notrailingwhitespace); +fprintf(fp, "%s", xml_notrailingwhitespace); +fprintf(fp, "%s", xml_notrailingwhitespace); fclose(fp); TEST_MSG("Test buffer parser with multiple documents in the same buffer."); @@ -341,7 +341,7 @@ TEST_MSG("Test buffer parser with multiple documents in the same buffer."); fp = fopen(XMLFILE, "w"); TEST_NOTEQUAL(fp, NULL, "Test if file \""XMLFILE"\" could be written."); if(!fp) TEST_FATAL("Could not write "XMLFILE); -fprintf(fp, xml_fail); +fprintf(fp, "%s", xml_fail); fclose(fp); TEST_MSG("Test failure"); @@ -359,7 +359,7 @@ goon: fp = fopen(XMLFILE, "w"); TEST_NOTEQUAL(fp, NULL, "Test if file \""XMLFILE"\" could be written."); if(!fp) TEST_FATAL("Could not write "XMLFILE); -fprintf(fp, xml_fail2); +fprintf(fp, "%s", xml_fail2); fclose(fp); // Test failure -- cgit v1.2.3