fix util_readline

Sat, 14 Dec 2019 09:31:59 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 14 Dec 2019 09:31:59 +0100
changeset 696
ec1509240080
parent 695
7877dae0d8fe
child 697
32f439d70127

fix util_readline

libidav/utils.c file | annotate | diff | comparison | revisions
--- a/libidav/utils.c	Thu Dec 12 20:58:30 2019 +0100
+++ b/libidav/utils.c	Sat Dec 14 09:31:59 2019 +0100
@@ -974,7 +974,10 @@
     UcxBuffer *buf = ucx_buffer_new(NULL, 128, UCX_BUFFER_AUTOEXTEND);
     
     int c;
-    while((c = fgetc(stream)) != '\n') {
+    while((c = fgetc(stream)) != EOF) {
+        if(c == '\n') {
+            break;
+        }
         ucx_buffer_putc(buf, c);
     }
     

mercurial