snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit be9104783e75548195ec9f9661d4a3365d300f85
parent 636d026e133d874daf39a84a7702253454644926
Author: default <nobody@localhost>
Date:   Tue,  4 Feb 2025 16:56:12 +0100

Don't append non-strings in xs_readline().

Diffstat:
Mxs_io.h | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xs_io.h b/xs_io.h @@ -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;