shithub: drawterm

Download patch

ref: e104d959104be40d6dd86e97a07ea44e38826562
parent: 7b58000c3d019d157fa5f1cc5621b0923e5b8539
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue May 4 19:52:20 EDT 2021

drawterm: properly handle enf of file in readstr() (from 9front cpu.c)

--- a/cpu.c	Wed Apr 14 14:46:13 2021
+++ b/cpu.c	Tue May  4 19:52:20 2021
@@ -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++;