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++;