attr_t attri;
int y, x;
char * keyname;
- for (y = 0; 0 != keybindings[offset + y].name && y < win->height; y++) {
+ for (y = 0; y <= keyswindata->max && y < win->height; y++) {
attri = 0;
if (y == keyswindata->select - offset) {
attri = A_REVERSE;
c = getc(file);
while (EOF != c) {
if ('\n' == c) {
- keybindings[keycount].name = calloc(commcount, sizeof(char));
+ keybindings[keycount].name = calloc(commcount + 1, sizeof(char));
memcpy(keybindings[keycount].name, command, commcount);
keybindings[keycount].key = key;
keycount++;
update_info (&win_info);
update_log (&win_log, "\nYou wait."); } }
+ free(map.cells);
+ for (key = 0; key <= world.keyswindata->max; key++)
+ free(world.keybindings[key].name);
+ free(world.keybindings);
+ free(world.keyswindata);
+ free(win_info.data);
+ free(win_log.data);
+
endwin();
return 0; }