Revert a bunch of strncmp() conversions

All strncmp() usages were replaced by (evidently) equivalent strcmp()
invocations in commit 2c9499bf27. However,
some of the strncmp() calls were perfectly justified and we actually
broke iCal import and "C-"-style key bindings by converting them to
strcmp(). Fix this by reverting all affected conversions.

Reported-by: Baptiste Jonglez <baptiste@jonglez.org>
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer
2012-03-30 15:45:30 +02:00
parent f3ccc70e37
commit d31cda5424
2 changed files with 23 additions and 23 deletions

View File

@@ -322,7 +322,7 @@ keys_str2int (char *key)
{
if (key[0] == '^')
return CTRL ((int)key[1]);
else if (!strcmp (key, CONTROL_KEY))
else if (!strncmp (key, CONTROL_KEY, sizeof (CONTROL_KEY) - 1))
return CTRL ((int)key[sizeof (CONTROL_KEY) - 1]);
else if (!strcmp (key, TAB_KEY))
return TAB;