fishlim: Use g_ascii_strncasecmp

This commit is contained in:
BakasuraRCE
2019-05-31 21:20:11 -05:00
parent 9fcfcebf83
commit ed2910909c

View File

@ -357,7 +357,6 @@ cleanup:
static int handle_setkey(char *word[], char *word_eol[], void *userdata) {
const char *nick;
const char *key;
char *key_lower;
enum fish_mode mode;
/* Check syntax */
@ -377,14 +376,12 @@ static int handle_setkey(char *word[], char *word_eol[], void *userdata) {
}
mode = FISH_ECB_MODE;
key_lower = g_ascii_strdown(key, -1);
if (strncmp("cbc:", key_lower, 4) == 0) {
if (g_ascii_strncasecmp("cbc:", key, 4) == 0) {
key = key+4;
mode = FISH_CBC_MODE;
} else if (strncmp("ecb:", key_lower, 4) == 0) {
} else if (g_ascii_strncasecmp("ecb:", key, 4) == 0) {
key = key+4;
}
g_free(key_lower);
/* Set password */
if (keystore_store_key(nick, key, mode)) {