From 70166c1e5f04385ff7aea3c62193dd53acac0129 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 11 Aug 2018 21:08:40 -0400 Subject: [PATCH] extkeys: Correct logical ANDs in get_kv() These two expressions would always be false as both sides of the expression would never be satisfied at the same time. --- extkeys.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extkeys.c b/extkeys.c index f831b53..6889282 100644 --- a/extkeys.c +++ b/extkeys.c @@ -94,9 +94,10 @@ static int get_kv(FILE *f, char **key, char **value) { } if (*p != '_' && - (*p < '0' && *p > '9') && - (*p < 'a' && *p > 'z')) + (*p < '0' || *p > '9') && + (*p < 'a' || *p > 'z')) { return -1; + } } /* Bail if the final ++p put us at the end of string */