summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authordeva <deva>2009-12-18 08:45:12 +0000
committerdeva <deva>2009-12-18 08:45:12 +0000
commit2f0bf2d0af5b9b749e6e195829fb7093fc8ab930 (patch)
tree37374c59ad77b30477929bf89689ac3c1645f792 /server/src
parent817072bf0ae27484394a77a016cfe07b35885b8a (diff)
Fix compiler warnings "format not a string literal and no format arguments". Actually exposed a bug in luaresume.cc
Diffstat (limited to 'server/src')
-rw-r--r--server/src/log.cc2
-rw-r--r--server/src/luaresume.cc2
-rw-r--r--server/src/macrotool.cc6
-rw-r--r--server/src/macrotool_dump.cc12
-rw-r--r--server/src/macrotool_fieldnames.cc12
-rw-r--r--server/src/macrotool_filehandler.cc10
-rw-r--r--server/src/macrotool_util.cc2
-rw-r--r--server/src/pracrod.cc6
-rw-r--r--server/src/queryhandlerpentominos.cc8
-rw-r--r--server/src/saxparser.cc10
-rw-r--r--server/src/server.cc2
11 files changed, 36 insertions, 36 deletions
diff --git a/server/src/log.cc b/server/src/log.cc
index 92a77f6..fe72422 100644
--- a/server/src/log.cc
+++ b/server/src/log.cc
@@ -39,5 +39,5 @@
void log(std::string message)
{
syslog(LOG_CONS, // Write to console if error sending to system logger.
- message.c_str());
+ "%s", message.c_str());
}
diff --git a/server/src/luaresume.cc b/server/src/luaresume.cc
index 15377d8..8ba5641 100644
--- a/server/src/luaresume.cc
+++ b/server/src/luaresume.cc
@@ -99,7 +99,7 @@ std::string LUAResume::run(std::string program)
return false;
}
- PRACRO_DEBUG("Running %s\n", program.c_str());
+ PRACRO_DEBUG(lua, "Running %s\n", program.c_str());
/*
lua_pushstring(L, value.toStdString().c_str());
diff --git a/server/src/macrotool.cc b/server/src/macrotool.cc
index bb8c8fc..40ca845 100644
--- a/server/src/macrotool.cc
+++ b/server/src/macrotool.cc
@@ -117,13 +117,13 @@ int main(int argc, char *argv[])
case '?':
case 'h':
- printf(version_str);
+ printf("%s", version_str);
printf(usage_str, argv[0]);
return 0;
case 'v':
- printf(version_str);
- printf(copyright_str);
+ printf("%s", version_str);
+ printf("%s", copyright_str);
return 0;
default:
diff --git a/server/src/macrotool_dump.cc b/server/src/macrotool_dump.cc
index 66b4ad7..f3f7e42 100644
--- a/server/src/macrotool_dump.cc
+++ b/server/src/macrotool_dump.cc
@@ -292,7 +292,7 @@ static void dump_templates()
void macrotool_dump(std::vector<std::string> params)
{
if(params.size() < 1) {
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
@@ -301,7 +301,7 @@ void macrotool_dump(std::vector<std::string> params)
if(params[0] == "fields") {
if(params.size() != 1) {
printf("The command 'fields' doen't take any parameters.\n");
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
dump_fields();
@@ -311,7 +311,7 @@ void macrotool_dump(std::vector<std::string> params)
if(params[0] == "macros") {
if(params.size() != 1) {
printf("The command 'macro' doen't take any parameters.\n");
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
dump_macros();
@@ -321,7 +321,7 @@ void macrotool_dump(std::vector<std::string> params)
if(params[0] == "templates") {
if(params.size() != 1) {
printf("The command 'templates' doen't take any parameters.\n");
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
dump_templates();
@@ -329,11 +329,11 @@ void macrotool_dump(std::vector<std::string> params)
}
if(params[0] == "help") {
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
printf("Unknown command '%s'\n", params[0].c_str());
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
diff --git a/server/src/macrotool_fieldnames.cc b/server/src/macrotool_fieldnames.cc
index 1d92df8..3a6e651 100644
--- a/server/src/macrotool_fieldnames.cc
+++ b/server/src/macrotool_fieldnames.cc
@@ -160,7 +160,7 @@ static void list()
void macrotool_fieldnames(std::vector<std::string> params)
{
if(params.size() < 1) {
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
@@ -169,7 +169,7 @@ void macrotool_fieldnames(std::vector<std::string> params)
if(params[0] == "list") {
if(params.size() != 1) {
printf("The command 'list' does not need any parameters.\n");
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
list();
@@ -179,7 +179,7 @@ void macrotool_fieldnames(std::vector<std::string> params)
if(params[0] == "add") {
if(params.size() != 3) {
printf("The command 'add' needs 2 parameters.\n");
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
add(params[1], params[2]);
@@ -189,7 +189,7 @@ void macrotool_fieldnames(std::vector<std::string> params)
if(params[0] == "del") {
if(params.size() != 2) {
printf("The command 'del' needs 1 parameter.\n");
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
del(params[1]);
@@ -197,11 +197,11 @@ void macrotool_fieldnames(std::vector<std::string> params)
}
if(params[0] == "help") {
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
printf("Unknown command '%s'\n", params[0].c_str());
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
diff --git a/server/src/macrotool_filehandler.cc b/server/src/macrotool_filehandler.cc
index d0245ba..c52921a 100644
--- a/server/src/macrotool_filehandler.cc
+++ b/server/src/macrotool_filehandler.cc
@@ -190,7 +190,7 @@ static void add(std::string file)
void macrotool_filehandler(std::vector<std::string> params)
{
if(params.size() < 1) {
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
@@ -199,7 +199,7 @@ void macrotool_filehandler(std::vector<std::string> params)
if(params[0] == "add") {
if(params.size() != 2) {
printf("The command 'add' needs 1 parameter.\n");
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
add(params[1]);
@@ -209,7 +209,7 @@ void macrotool_filehandler(std::vector<std::string> params)
if(params[0] == "check") {
if(params.size() != 2) {
printf("The command 'check' needs 1 parameter.\n");
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
check(params[1]);
@@ -217,11 +217,11 @@ void macrotool_filehandler(std::vector<std::string> params)
}
if(params[0] == "help") {
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
printf("Unknown command '%s'\n", params[0].c_str());
- printf(usage_str);
+ printf("%s", usage_str);
return;
}
diff --git a/server/src/macrotool_util.cc b/server/src/macrotool_util.cc
index d6446f7..003e929 100644
--- a/server/src/macrotool_util.cc
+++ b/server/src/macrotool_util.cc
@@ -71,7 +71,7 @@ std::vector<std::string> getTemplates()
void printcolumn(std::string text, size_t width)
{
- printf(text.c_str());
+ printf("%s", text.c_str());
for(size_t i = text.length(); i < width; i++) printf(" ");
printf("\t");
}
diff --git a/server/src/pracrod.cc b/server/src/pracrod.cc
index 75f58a6..d17001c 100644
--- a/server/src/pracrod.cc
+++ b/server/src/pracrod.cc
@@ -202,13 +202,13 @@ int main(int argc, char *argv[])
case '?':
case 'h':
- printf(version_str);
+ printf("%s", version_str);
printf(usage_str, argv[0]);
return 0;
case 'v':
- printf(version_str);
- printf(copyright_str);
+ printf("%s", version_str);
+ printf("%s", copyright_str);
return 0;
default:
diff --git a/server/src/queryhandlerpentominos.cc b/server/src/queryhandlerpentominos.cc
index c52b36c..62a742f 100644
--- a/server/src/queryhandlerpentominos.cc
+++ b/server/src/queryhandlerpentominos.cc
@@ -157,7 +157,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query)
socket.write(header, strlen(header));
#endif/*WITHOUT_PENTOMINOS*/
- PRACRO_DEBUG(queryhandler, header);
+ PRACRO_DEBUG(queryhandler, "%s", header);
sprintf(buf, " <pentominos:entry replyformat=\"xml\"\n"
" cpr=\"%s\"\n"
@@ -181,7 +181,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query)
socket.write(buf, strlen(buf));
#endif/*WITHOUT_PENTOMINOS*/
- PRACRO_DEBUG(queryhandler, buf);
+ PRACRO_DEBUG(queryhandler, "%s", buf);
sprintf(buf, " <pentominos:query device_id=\"%s\"\n"
" device_type=\"%s\"\n"
@@ -194,7 +194,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query)
socket.write(buf, strlen(buf));
#endif/*WITHOUT_PENTOMINOS*/
- PRACRO_DEBUG(queryhandler, buf);
+ PRACRO_DEBUG(queryhandler, "%s", buf);
sprintf(buf, "</artefact>");
@@ -202,7 +202,7 @@ QueryResult QueryHandlerPentominos::exec(Query &query)
socket.write(buf, strlen(buf));
#endif/*WITHOUT_PENTOMINOS*/
- PRACRO_DEBUG(queryhandler, buf);
+ PRACRO_DEBUG(queryhandler, "%s", buf);
QueryResult result;
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
diff --git a/server/src/server.cc b/server/src/server.cc
index 6a2a61b..b264426 100644
--- a/server/src/server.cc
+++ b/server/src/server.cc
@@ -495,7 +495,7 @@ void server()
char errbuf[128];
snprintf(errbuf, sizeof(errbuf), "There are %d live sessions."
" Kill again to force shutdown.\n", conn.sessions.size());
- PRACRO_ERR_LOG(server, errbuf);
+ PRACRO_ERR_LOG(server, "%s", errbuf);
log(errbuf);
pracro_is_running = true;
forceshutdown = true;