ref: e104d959104be40d6dd86e97a07ea44e38826562
parent: 7b58000c3d019d157fa5f1cc5621b0923e5b8539
author: cinap_lenrek <[email protected]>
date: Tue May 4 21:52:20 EDT 2021
drawterm: properly handle enf of file in readstr() (from 9front cpu.c)
--- a/cpu.c
+++ b/cpu.c
@@ -407,6 +407,10 @@
n = read(fd, str, 1);
if(n < 0)
return -1;
+ if(n == 0){
+ werrstr("hung up");
+ return -1;
+ }
if(*str == '\0')
return 0;
str++;