From 407b5d32156d60420f83d6e0567e9b3e9c878ad9 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Wed, 21 Aug 2024 23:14:20 +0200 Subject: 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 Date: Fri Nov 24 00:52:50 2023 +0100 http.c: Unify read operations --- http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- cgit v1.2.3