commit 8c406bc875e2893564721eeafe1c51b1a25192b0
parent c53da9aa5bffd4822fdf414cd8f930e45659b028
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 6 Jan 2021 10:05:35 +0100
tweaks: change an intermediate variable to a better one
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -2135,17 +2135,17 @@ void minibar(void)
/* Display the hexadecimal code of the character under the cursor. */
if (namewidth + tallywidth + 28 < COLS) {
- char *thisline = openfile->current->data;
+ char *this_position = openfile->current->data + openfile->current_x;
- if (thisline[openfile->current_x] == '\0')
+ if (*this_position == '\0')
sprintf(hexadecimal, openfile->current->next ? "U+000A" : "------");
- else if (thisline[openfile->current_x] == '\n')
+ else if (*this_position == '\n')
sprintf(hexadecimal, "U+0000");
- else if ((unsigned char)thisline[openfile->current_x] >= 0x80 &&
- mbtowc(&widecode, thisline + openfile->current_x, MAXCHARLEN) >= 0)
+ else if ((unsigned char)*this_position >= 0x80 &&
+ mbtowc(&widecode, this_position, MAXCHARLEN) >= 0)
sprintf(hexadecimal, "U+%04X", widecode);
else
- sprintf(hexadecimal, "U+%04X", (unsigned char)thisline[openfile->current_x]);
+ sprintf(hexadecimal, "U+%04X", (unsigned char)*this_position);
mvwaddstr(bottomwin, 0, COLS - 23, hexadecimal);
}