Fix regression in kilo example

This commit is contained in:
Justine Tunney 2022-03-18 13:31:47 -07:00
parent 96bdd7e90f
commit c4d8f40422
2 changed files with 6 additions and 2 deletions

View file

@ -249,7 +249,10 @@ fatal:
int editorReadKey(int64_t fd) {
int nread;
char c, seq[3];
if ((nread = read(fd, &c, 1)) == -1) exit(1);
do {
nread = read(fd, &c, 1);
if (nread == -1) exit(1);
} while (!nread);
while (1) {
switch (c) {