diff options
| author | default <nobody@localhost> | 2025-02-04 16:56:12 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2025-02-04 16:56:12 +0100 |
| commit | be9104783e75548195ec9f9661d4a3365d300f85 (patch) | |
| tree | be64fced948c3f14859b6fcf3ab81ef375e0b1bd | |
| parent | 636d026e133d874daf39a84a7702253454644926 (diff) | |
Don't append non-strings in xs_readline().
| -rw-r--r-- | xs_io.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -27,7 +27,8 @@ xs_str *xs_readline(FILE *f) while ((c = fgetc(f)) != EOF) { unsigned char rc = c; - s = xs_append_m(s, (char *)&rc, 1); + if (xs_is_string((char *)&rc)) + s = xs_append_m(s, (char *)&rc, 1); if (c == '\n') break; |