aboutsummaryrefslogtreecommitdiff
path: root/xs_io.h
diff options
context:
space:
mode:
authorSanttu Lakkala <inz@inz.fi>2025-02-06 00:47:49 +0200
committerSanttu Lakkala <santtu.lakkala@unikie.com>2025-02-06 00:47:49 +0200
commit1089b24171934bc742c2e438f17ec1774b90c728 (patch)
treefe536ad310dcd25e0ceab11ef7700a6484a5e3d5 /xs_io.h
parentde8fd8305396abd1e7e7208f443be4a4891219cd (diff)
Rewrite http header parsing
Diffstat (limited to 'xs_io.h')
-rw-r--r--xs_io.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/xs_io.h b/xs_io.h
index 8fc5d6f..9c5018e 100644
--- a/xs_io.h
+++ b/xs_io.h
@@ -14,7 +14,7 @@ xs_val *xs_readall(FILE *f);
xs_str *xs_readline(FILE *f)
/* reads a line from a file */
{
- xs_str *s = NULL;
+ xs_str *s = xs_str_new(NULL);
errno = 0;
@@ -22,8 +22,6 @@ xs_str *xs_readline(FILE *f)
if (!feof(f)) {
int c;
- s = xs_str_new(NULL);
-
while ((c = fgetc(f)) != EOF) {
unsigned char rc = c;