commit e679c518b157e08b48038ea3e9a404acea0c2abd
parent ba9214c689b425a4fec07552db9cb5db597af0ab
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Fri, 24 Jun 2016 15:39:03 +0200
tweaks: elide an unneeded variable
Diffstat:
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -1209,21 +1209,18 @@ int get_byte_kbinput(int kbinput)
#ifdef ENABLE_UTF8
/* If the character in kbinput is a valid hexadecimal digit, multiply it
- * by factor and add the result to uni. */
+ * by factor and add the result to uni, and return ERR to signify okay. */
long add_unicode_digit(int kbinput, long factor, long *uni)
{
- long retval = ERR;
-
if ('0' <= kbinput && kbinput <= '9')
*uni += (kbinput - '0') * factor;
else if ('a' <= tolower(kbinput) && tolower(kbinput) <= 'f')
*uni += (tolower(kbinput) - 'a' + 10) * factor;
else
- /* If this character isn't a valid hexadecimal value, save it as
- * the result. */
- retval = kbinput;
+ /* The character isn't hexadecimal; give it as the result. */
+ return (long)kbinput;
- return retval;
+ return ERR;
}
/* Translate a Unicode sequence: turn a six-digit hexadecimal number