widelands/widelands-0.17-format-not-string-literal.patch
2012-06-06 14:00:02 +04:00

58 lines
2.1 KiB
Diff

--- widelands-build17-src/src/io/dedicated_log.cc.orig 2012-06-01 23:40:41.870348231 +0400
+++ widelands-build17-src/src/io/dedicated_log.cc 2012-06-01 23:42:03.716344829 +0400
@@ -78,7 +78,7 @@
temp += c.sender.empty() ? "SYSTEM" : c.sender;
temp += "</td><td class=\"recipient\"> ->" + c.recipient + "</td><td class=\"message\">";
temp += c.msg + "</td></tr>\n";
- m_chat.Printf(temp.c_str());
+ m_chat.Printf("%s",temp.c_str());
m_chat.WriteAppend(*root, m_chat_file_path.c_str());
}
@@ -185,7 +185,7 @@
}
}
temp += "</table>\n";
- m_chat.Printf(temp.c_str());
+ m_chat.Printf("%s", temp.c_str());
m_chat.Write(*root, m_info_file_path.c_str());
}
@@ -197,7 +197,7 @@
std::string temp("<tr><td class=\"log\">");
temp += msg;
temp += "</td></tr>\n";
- m_chat.Printf(temp.c_str());
+ m_chat.Printf("%s", temp.c_str());
m_chat.WriteAppend(*root, m_log_file_path.c_str());
}
--- widelands-build17-src/src/network/internet_gaming.cc.orig 2012-06-01 23:53:57.475314766 +0400
+++ widelands-build17-src/src/network/internet_gaming.cc 2012-06-01 23:56:16.960308823 +0400
@@ -364,7 +364,7 @@
throw warning
(_
("Expected a LOGIN, RELOGIN or REJECTED packet from server, but received command "
- "%s. Maybe the metaserver is using a different protocol version ?"),
+ "%s. Maybe the metaserver is using a different protocol version ?"),"%s",
cmd.c_str());
}
}
@@ -403,7 +403,7 @@
std::string type = packet.String();
if (type != "public" && type != "private" && type != "system")
- throw warning("Invalid chat message type \"%s\".", type.c_str());
+ throw warning("Invalid chat message type \"%s\".", "%s", type.c_str());
bool personal = type == "private";
bool system = type == "system";
@@ -708,7 +708,7 @@
*/
bool InternetGaming::str2bool(std::string str) {
if ((str != "true") && (str != "false"))
- throw warning("Conversion from std::string to bool failed. String was \"%s\"", str.c_str());
+ throw warning("Conversion from std::string to bool failed. String was \"%s\"", "%s", str.c_str());
return str == "true";
}