summaryrefslogtreecommitdiffstats
path: root/client/hot_keys.cpp
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-03-13 15:28:26 +0000
committerDaniel P. Berrange <berrange@redhat.com>2012-04-25 09:42:11 +0100
commit6a8b7585e2051baa911b665ed713835bc65515d6 (patch)
tree348a1d418b42a4565c96b9f183b8be451c5d7468 /client/hot_keys.cpp
parent832a98800d7ec97796eec3697e00e81f92a07898 (diff)
downloadspice-6a8b7585e2051baa911b665ed713835bc65515d6.tar.gz
spice-6a8b7585e2051baa911b665ed713835bc65515d6.tar.xz
spice-6a8b7585e2051baa911b665ed713835bc65515d6.zip
Fix multiple printf format problems
All printf var-args style methods should be annotation with their format. All format strings must be const strings. * client/application.cpp, client/cmd_line_parser.cpp, client/hot_keys.cpp: Avoid non-const format * client/client_net_socket.cpp: Fix broken format specifier * client/red_peer.cpp: Fix missing format specifier * client/platform.h: Add SPICE_GNUC_PRINTF annotation to term_printf * client/utils.h: Add SPICE_GNUC_PRINTF annotation to string_printf * server/glz_encoder_config.h, server/red_worker.c: Add SPICE_GNUC_PRINTF annotation to warning callbacks Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'client/hot_keys.cpp')
-rw-r--r--client/hot_keys.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/client/hot_keys.cpp b/client/hot_keys.cpp
index 2d0b9db4..763ba2ca 100644
--- a/client/hot_keys.cpp
+++ b/client/hot_keys.cpp
@@ -139,9 +139,7 @@ void HotKeysParser::add_hotkey(const std::string& hotkey, const CommandsMap& com
std::string command_name = hotkey.substr(0, key_start);
if (commands_map.find(command_name) == commands_map.end()) {
- char buf[1000];
- snprintf(buf, sizeof(buf), "invalid action bname %s", command_name.c_str());
- THROW(buf);
+ THROW("invalid action bname %s", command_name.c_str());
}
int command_id = commands_map.find(command_name)->second;
std::string keys = hotkey.substr(key_start + 1);