From 8c406bc875e2893564721eeafe1c51b1a25192b0 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 6 Jan 2021 10:05:35 +0100 Subject: [PATCH] tweaks: change an intermediate variable to a better one --- src/winio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/winio.c b/src/winio.c index 2ad5b1ac..2b7cf761 100644 --- 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); }