From: Jonathan Neuschäfer Date: Fri, 3 Feb 2012 18:44:33 +0000 (+0100) Subject: screen_keydef: don't crash on Ctrl-Space X-Git-Tag: release-0.20~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=07fbd89ee60e798abe48280505cd45a9bdf64b12;p=ncmpc.git screen_keydef: don't crash on Ctrl-Space --- diff --git a/src/screen_keydef.c b/src/screen_keydef.c index 4519008..32791b8 100644 --- a/src/screen_keydef.c +++ b/src/screen_keydef.c @@ -265,11 +265,16 @@ overwrite_key(int cmd_index, int key_index) key = screen_getch(buf); g_free(buf); - if (key==ERR) { + if (key == ERR) { screen_status_printf(_("Aborted")); return; } + if (key == '\0') { + screen_status_printf(_("Ctrl-Space can't be used")); + return; + } + cmd = find_key_command(key, cmds); if (cmd != CMD_NONE) { screen_status_printf(_("Error: key %s is already used for %s"),