From a2f8703df5a9cf7b13416c250f329a87436e0feb Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 31 Jan 2020 16:05:51 +0100 Subject: [PATCH] tweaks: tumble three conditions, for consistency in comparisons --- src/nano.c | 2 +- src/winio.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nano.c b/src/nano.c index aee69f74..ce605a17 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1476,7 +1476,7 @@ void suck_up_input_and_paste_it(void) line = line->next; line->data = copy_of(""); index = 0; - } else if ((input >= 0x20 && input <= 0xFF && input != DEL_CODE) || + } else if ((0x20 <= input && input <= 0xFF && input != DEL_CODE) || input == TAB_CODE) { line->data = charealloc(line->data, index + 2); line->data[index++] = (char)input; diff --git a/src/winio.c b/src/winio.c index e2327a8d..4fbd2894 100644 --- a/src/winio.c +++ b/src/winio.c @@ -934,7 +934,7 @@ int parse_kbinput(WINDOW *win) key_buffer_len == 0 || *key_buffer == ESC_CODE) { /* One escape followed by a single non-escape: * meta key sequence mode. */ - if (!solitary || (keycode >= 0x20 && keycode < 0x7F)) + if (!solitary || (0x20 <= keycode && keycode <= 0x7E)) meta_key = TRUE; retval = (shifted_metas) ? keycode : tolower(keycode); } else @@ -3091,7 +3091,7 @@ size_t get_chunk_and_edge(size_t column, linestruct *line, size_t *leftedge) end_col = get_softwrap_breakpoint(line->data, start_col, &end_of_line); /* We reached the end of the line and/or found column, so get out. */ - if (end_of_line || (column >= start_col && column < end_col)) { + if (end_of_line || (start_col <= column && column < end_col)) { if (leftedge != NULL) *leftedge = start_col; return current_chunk;