X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fkeybindings.c;h=c318ec18f49c1501c0e72640d7e01db01303350a;hb=e55ff0044903e9af87e24d01a809ce0a0c562633;hp=3809416489b4037857b5bb3a5de6062599772f3e;hpb=e11aa749989942b66dfc4fd7ccb72c2c8e767332;p=plomrogue
diff --git a/src/keybindings.c b/src/keybindings.c
index 3809416..c318ec1 100644
--- a/src/keybindings.c
+++ b/src/keybindings.c
@@ -10,12 +10,13 @@
#include "windows.h" /* for draw_all_wins() and WinMeta struct */
#include "misc.h" /* for texfile_sizes() */
#include "main.h" /* for World struct */
+#include "rexit.h" /* for err_exit() */
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));
@@ -48,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++)
@@ -169,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;
- draw_all_wins (win_meta);
+ exit_err(draw_all_wins(win_meta), world, "Trouble with draw_all_wins() in "
+ "keyswin_mod_key().");
int key = getch();
if (key < 1000)
{