aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/vi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 3dbe5b471..d37cd48a3 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -1122,7 +1122,7 @@ static int readit(void) // read (maybe cursor) key from stdin
1122 // on nonblocking stdin. 1122 // on nonblocking stdin.
1123 // Note: read_key sets errno to 0 on success. 1123 // Note: read_key sets errno to 0 on success.
1124 again: 1124 again:
1125 c = read_key(STDIN_FILENO, readbuffer, /*timeout:*/ -1); 1125 c = safe_read_key(STDIN_FILENO, readbuffer, /*timeout:*/ -1);
1126 if (c == -1) { // EOF/error 1126 if (c == -1) { // EOF/error
1127 if (errno == EAGAIN) // paranoia 1127 if (errno == EAGAIN) // paranoia
1128 goto again; 1128 goto again;
@@ -4770,7 +4770,7 @@ static void edit_file(char *fn)
4770 uint64_t k; 4770 uint64_t k;
4771 write1(ESC"[999;999H" ESC"[6n"); 4771 write1(ESC"[999;999H" ESC"[6n");
4772 fflush_all(); 4772 fflush_all();
4773 k = read_key(STDIN_FILENO, readbuffer, /*timeout_ms:*/ 100); 4773 k = safe_read_key(STDIN_FILENO, readbuffer, /*timeout_ms:*/ 100);
4774 if ((int32_t)k == KEYCODE_CURSOR_POS) { 4774 if ((int32_t)k == KEYCODE_CURSOR_POS) {
4775 uint32_t rc = (k >> 32); 4775 uint32_t rc = (k >> 32);
4776 columns = (rc & 0x7fff); 4776 columns = (rc & 0x7fff);