home · contact · privacy
Client: Fix outdated comment.
[plomrogue] / src / client / keybindings.c
index f148afa3371744a0c804ce84266bfb1858589f7d..10cbffba43f48d261f389ca8a3f02d9a27a11b85 100644 (file)
@@ -11,7 +11,7 @@
 #include "../common/readwrite.h" /* try_fwrite()*/
 #include "../common/try_malloc.h" /* try_malloc() */
 #include "command_db.h" /* get_command() */
-#include "misc.h" /* array_append() */
+#include "array_append.h" /* array_append() */
 #include "windows.h" /* draw_all_wins() */
 #include "world.h" /* global world */
 
@@ -57,7 +57,7 @@ static uint8_t try_keycode(uint16_t keycode_given, char * keyname,
 {
     if (keycode_given == keycode_match)
     {
-        sprintf(keyname, keyname_match);
+        sprintf(keyname, "%s", keyname_match);
         return 1;
     }
     return 0;
@@ -84,7 +84,7 @@ extern struct Command * get_command_to_keycode(struct KeyBindingDB * kbdb,
 extern char * get_keyname_to_keycode(uint16_t keycode)
 {
     char * f_name = "get_name_to_keycode()";
-    char * keyname = try_malloc(15, f_name);                /* FIXME: Why 15? */
+    char * keyname = try_malloc(10, f_name);        /* max keyname length + 1 */
     if (32 < keycode && keycode < 127)
     {
         sprintf(keyname, "%c", keycode);