aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-08-21 23:14:20 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-08-22 02:24:42 +0200
commit407b5d32156d60420f83d6e0567e9b3e9c878ad9 (patch)
treedb9a093e017decea898c5dc44f127e0259c2d612 /http.c
parentb4930f72bb9026c5a0871f4fa4cabe20cb0e6a9f (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
Diffstat (limited to 'http.c')
-rw-r--r--http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/http.c b/http.c
index 19a1b93..cf2dd8c 100644
--- a/http.c
+++ b/http.c
@@ -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));