diff options
| author | 2025-02-06 00:47:49 +0200 | |
|---|---|---|
| committer | 2025-02-06 00:47:49 +0200 | |
| commit | 1089b24171934bc742c2e438f17ec1774b90c728 (patch) | |
| tree | fe536ad310dcd25e0ceab11ef7700a6484a5e3d5 /xs_io.h | |
| parent | More HTML tweaks. (diff) | |
| download | snac2-1089b24171934bc742c2e438f17ec1774b90c728.tar.gz snac2-1089b24171934bc742c2e438f17ec1774b90c728.tar.xz snac2-1089b24171934bc742c2e438f17ec1774b90c728.zip | |
Rewrite http header parsing
Diffstat (limited to 'xs_io.h')
| -rw-r--r-- | xs_io.h | 4 |
1 files changed, 1 insertions, 3 deletions
| @@ -14,7 +14,7 @@ xs_val *xs_readall(FILE *f); | |||
| 14 | xs_str *xs_readline(FILE *f) | 14 | xs_str *xs_readline(FILE *f) |
| 15 | /* reads a line from a file */ | 15 | /* reads a line from a file */ |
| 16 | { | 16 | { |
| 17 | xs_str *s = NULL; | 17 | xs_str *s = xs_str_new(NULL); |
| 18 | 18 | ||
| 19 | errno = 0; | 19 | errno = 0; |
| 20 | 20 | ||
| @@ -22,8 +22,6 @@ xs_str *xs_readline(FILE *f) | |||
| 22 | if (!feof(f)) { | 22 | if (!feof(f)) { |
| 23 | int c; | 23 | int c; |
| 24 | 24 | ||
| 25 | s = xs_str_new(NULL); | ||
| 26 | |||
| 27 | while ((c = fgetc(f)) != EOF) { | 25 | while ((c = fgetc(f)) != EOF) { |
| 28 | unsigned char rc = c; | 26 | unsigned char rc = c; |
| 29 | 27 | ||