From ca70c2ae2217e20cebfe3b8a7aa967cba20e5b4f Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 4 Oct 2024 15:15:16 +0200 Subject: http.c: Avoid isspace(3) in get_boundary According to POSIX.1-2008, this function is sensitive to the system locale, which might then have different definitions for a whitespace character. Therefore, it is safer to only check against ' ' so as to remove such a dependency. --- http.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/http.c b/http.c index e9b50ac..c3ff25a 100644 --- a/http.c +++ b/http.c @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -956,7 +955,7 @@ static int get_boundary(const char *bnd, char *const buf, const size_t n) __func__, res, n); return 1; } - else if (isspace(buf[res - 1])) + else if (buf[res - 1] == ' ') { fprintf(stderr, "%s: boundary ends with whitespace character: %s\n", __func__, buf); -- cgit v1.2.3