aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/ed.c2
-rw-r--r--editors/vi.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/editors/ed.c b/editors/ed.c
index 2f3bf03bf..0961cc38e 100644
--- a/editors/ed.c
+++ b/editors/ed.c
@@ -825,7 +825,7 @@ static int printLines(int num1, int num2, int expandFlag)
825 825
826 while (num1 <= num2) { 826 while (num1 <= num2) {
827 if (!expandFlag) { 827 if (!expandFlag) {
828 write(1, lp->data, lp->len); 828 write(STDOUT_FILENO, lp->data, lp->len);
829 setCurNum(num1++); 829 setCurNum(num1++);
830 lp = lp->next; 830 lp = lp->next;
831 continue; 831 continue;
diff --git a/editors/vi.c b/editors/vi.c
index dded6edb3..1770d98c5 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2220,7 +2220,7 @@ static char readit(void) // read (maybe cursor) key from stdin
2220 // get input from User- are there already input chars in Q? 2220 // get input from User- are there already input chars in Q?
2221 if (n <= 0) { 2221 if (n <= 0) {
2222 // the Q is empty, wait for a typed char 2222 // the Q is empty, wait for a typed char
2223 n = safe_read(0, readbuffer, sizeof(readbuffer)); 2223 n = safe_read(STDIN_FILENO, readbuffer, sizeof(readbuffer));
2224 if (n < 0) { 2224 if (n < 0) {
2225 if (errno == EBADF || errno == EFAULT || errno == EINVAL 2225 if (errno == EBADF || errno == EFAULT || errno == EINVAL
2226 || errno == EIO) 2226 || errno == EIO)
@@ -2243,7 +2243,7 @@ static char readit(void) // read (maybe cursor) key from stdin
2243 && ((size_t)n <= (sizeof(readbuffer) - 8)) 2243 && ((size_t)n <= (sizeof(readbuffer) - 8))
2244 ) { 2244 ) {
2245 // read the rest of the ESC string 2245 // read the rest of the ESC string
2246 int r = safe_read(0, readbuffer + n, sizeof(readbuffer) - n); 2246 int r = safe_read(STDIN_FILENO, readbuffer + n, sizeof(readbuffer) - n);
2247 if (r > 0) 2247 if (r > 0)
2248 n += r; 2248 n += r;
2249 } 2249 }
@@ -4035,7 +4035,7 @@ static void crash_test()
4035 printf("\n\n%d: \'%c\' %s\n\n\n%s[Hit return to continue]%s", 4035 printf("\n\n%d: \'%c\' %s\n\n\n%s[Hit return to continue]%s",
4036 totalcmds, last_input_char, msg, SOs, SOn); 4036 totalcmds, last_input_char, msg, SOs, SOn);
4037 fflush(stdout); 4037 fflush(stdout);
4038 while (safe_read(0, d, 1) > 0) { 4038 while (safe_read(STDIN_FILENO, d, 1) > 0) {
4039 if (d[0] == '\n' || d[0] == '\r') 4039 if (d[0] == '\n' || d[0] == '\r')
4040 break; 4040 break;
4041 } 4041 }