aboutsummaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c
index b973cc056..b30369302 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -1182,7 +1182,7 @@ static int readit(void) // read (maybe cursor) key from stdin
1182 // on nonblocking stdin. 1182 // on nonblocking stdin.
1183 // Note: read_key sets errno to 0 on success. 1183 // Note: read_key sets errno to 0 on success.
1184 again: 1184 again:
1185 c = read_key(STDIN_FILENO, readbuffer, /*timeout:*/ -1); 1185 c = safe_read_key(STDIN_FILENO, readbuffer, /*timeout:*/ -1);
1186 if (c == -1) { // EOF/error 1186 if (c == -1) { // EOF/error
1187 if (errno == EAGAIN) // paranoia 1187 if (errno == EAGAIN) // paranoia
1188 goto again; 1188 goto again;
@@ -4930,7 +4930,7 @@ static void edit_file(char *fn)
4930 uint64_t k; 4930 uint64_t k;
4931 write1(ESC"[999;999H" ESC"[6n"); 4931 write1(ESC"[999;999H" ESC"[6n");
4932 fflush_all(); 4932 fflush_all();
4933 k = read_key(STDIN_FILENO, readbuffer, /*timeout_ms:*/ 100); 4933 k = safe_read_key(STDIN_FILENO, readbuffer, /*timeout_ms:*/ 100);
4934 if ((int32_t)k == KEYCODE_CURSOR_POS) { 4934 if ((int32_t)k == KEYCODE_CURSOR_POS) {
4935 uint32_t rc = (k >> 32); 4935 uint32_t rc = (k >> 32);
4936 columns = (rc & 0x7fff); 4936 columns = (rc & 0x7fff);