diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-08-21 23:14:20 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-08-22 02:24:42 +0200 |
| commit | 407b5d32156d60420f83d6e0567e9b3e9c878ad9 (patch) | |
| tree | db9a093e017decea898c5dc44f127e0259c2d612 | |
| parent | b4930f72bb9026c5a0871f4fa4cabe20cb0e6a9f (diff) | |
http.c: Fix wrong check
p->f is a FILE *, so it is invalid to check against negative values.
This bug was introduced when p->fd, a file descriptor, was replaced with
p->f, a FILE *, by the following commit:
commit b0accd099fa8c5110d4c3c68830ad6fd810ca3ec
Author: Xavier Del Campo Romero <xavi.dcr@tutanota.com>
Date: Fri Nov 24 00:52:50 2023 +0100
http.c: Unify read operations
| -rw-r--r-- | http.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -493,7 +493,7 @@ static void ctx_free(struct ctx *const c) { struct put *const p = &c->u.put; - if (p->f >= 0 && fclose(p->f)) + if (p->f && fclose(p->f)) fprintf(stderr, "%s: fclose(3) p->f: %s\n", __func__, strerror(errno)); |
