cstring: fix readline for empty lines
authorNiki <david.roulet@solidaris.be>
Tue, 25 Jun 2024 14:56:41 +0000 (16:56 +0200)
committerNiki <david.roulet@solidaris.be>
Tue, 25 Jun 2024 14:56:41 +0000 (16:56 +0200)
cstring.c

index 5a4d81ac2510c8dc6c4ec0d9a09d6aec8209c2d6..f27580f23427e5a6c4a84e0330fca21ed80be7d7 100644 (file)
--- a/cstring.c
+++ b/cstring.c
@@ -648,7 +648,7 @@ int cstring_readline(cstring_t *self, FILE *file) {
        }
        
        cstring_clear(self);
-       return 0;
+       return !feof(file);
 }
 
 static void normalize_path(cstring_t *self) {