commit be91047

default  ·  2025-02-04 15:56:12 +0000 UTC
parent 636d026
Don't append non-strings in xs_readline().
1 files changed,  +2, -1
+2, -1
 1@@ -27,7 +27,8 @@ xs_str *xs_readline(FILE *f)
 2         while ((c = fgetc(f)) != EOF) {
 3             unsigned char rc = c;
 4 
 5-            s = xs_append_m(s, (char *)&rc, 1);
 6+            if (xs_is_string((char *)&rc))
 7+                s = xs_append_m(s, (char *)&rc, 1);
 8 
 9             if (c == '\n')
10                 break;