home · contact · privacy
Clean up memory allocated for Win structs.
[plomrogue] / src / keybindings.c
index 0b5194c4eec8d585a7b024c0acacab65f5da8287..c318ec18f49c1501c0e72640d7e01db01303350a 100644 (file)
@@ -16,7 +16,7 @@
 
 extern void init_keybindings(struct World * world)
 {
-    FILE * file = fopen("keybindings", "r");
+    FILE * file = fopen("config/keybindings", "r");
     uint16_t lines, linemax;
     textfile_sizes(file, &linemax, &lines);
     struct KeyBinding * keybindings = malloc(lines * sizeof(struct KeyBinding));
@@ -49,7 +49,7 @@ extern void save_keybindings(struct World * world)
     struct KeysWinData * keyswindata = (struct KeysWinData *)
                                        world->keyswindata;
     struct KeyBinding * keybindings = world->keybindings;
-    FILE * file = fopen("keybindings", "w");
+    FILE * file = fopen("config/keybindings", "w");
     uint16_t linemax = 0;
     uint16_t i;
     for (i = 0; i <= keyswindata->max; i++)
@@ -170,7 +170,8 @@ extern char * get_keyname(uint16_t keycode)
 extern void keyswin_mod_key(struct World * world, struct WinMeta * win_meta)
 {
     world->keyswindata->edit = 1;
-    exit_err(draw_all_wins(win_meta), world, "Window drawing error.");
+    exit_err(draw_all_wins(win_meta), world, "Trouble with draw_all_wins() in "
+                                             "keyswin_mod_key().");
     int key = getch();
     if (key < 1000)
     {