diff calypso/tpinterf.c @ 7:b25d4dfe5798

fcsim-calypso-be actually works now
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 14 Mar 2021 05:33:51 +0000
parents deeeef558279
children
line wrap: on
line diff
--- a/calypso/tpinterf.c	Sun Mar 14 05:26:58 2021 +0000
+++ b/calypso/tpinterf.c	Sun Mar 14 05:33:51 2021 +0000
@@ -136,10 +136,10 @@
 	char buf[1024], *cp;
 	fd_set fds;
 	struct timeval tv;
-	int cc, newline = 1, termflag = 0;
+	int cc, newline = 1, termflag = 0, finish = 0;
 	unsigned goodchar;
 
-	for (goodchar = 0; ; ) {
+	for (goodchar = 0; !finish; ) {
 		FD_ZERO(&fds);
 		FD_SET(target_fd, &fds);
 		tv.tv_sec = timeout;
@@ -164,8 +164,10 @@
 		}
 		for (cp = buf + goodchar; cc; cp++) {
 			cc--;
-			if (*cp == '=' && newline && !cc)
+			if (*cp == '=' && newline && !cc) {
+				finish = 1;
 				break;
+			}
 			if (*cp == '\n') {
 				newline = 1;
 				termflag = 1;