commit 5917f40
Devine Lu Linvega
·
2023-03-18 18:12:48 +0000 UTC
parent 5ef6a7a
Formatted
2 files changed,
+6,
-8
+4,
-6
1@@ -226,7 +226,7 @@ int
2 main(int argc, char **argv)
3 {
4 Uxn u;
5- int i,n;
6+ int i, n;
7 char expirations[8];
8 char coninp[CONINBUFSIZE];
9 struct pollfd fds[3];
10@@ -263,12 +263,10 @@ main(int argc, char **argv)
11 read(fds[1].fd, expirations, 8); /* Indicate we handled the timer */
12 uxn_eval(&u, GETVEC(&u.dev[0x20])); /* Call the vector once, even if the timer fired multiple times */
13 }
14- if ((fds[2].revents & POLLIN)!=0)
15- {
16- n = read(fds[2].fd, coninp, CONINBUFSIZE-1);
17+ if((fds[2].revents & POLLIN) != 0) {
18+ n = read(fds[2].fd, coninp, CONINBUFSIZE - 1);
19 coninp[n] = 0;
20- for (i=0;i<n;i++)
21- {
22+ for(i = 0; i < n; i++) {
23 console_input(&u, coninp[i]);
24 }
25 }
+2,
-2
1@@ -37,8 +37,8 @@ console_input(Uxn *u, char c)
2 static void
3 console_deo(Uint8 *d, Uint8 port)
4 {
5- FILE *fd = port == 0x8 ? stdout : port == 0x9 ? stderr
6- : 0;
7+ FILE *fd = port == 0x8 ? stdout : port == 0x9 ? stderr :
8+ 0;
9 if(fd) {
10 fputc(d[port], fd);
11 fflush(fd);