diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-10-04 15:15:16 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2024-10-04 15:15:16 +0200 |
| commit | ca70c2ae2217e20cebfe3b8a7aa967cba20e5b4f (patch) | |
| tree | 558875d2815bb24d1afbf84ee23fe70e4fb3b8d6 /http.c | |
| parent | 872bfc2f8faf2000703f26ebb88a68ab0f356a7d (diff) | |
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.
Diffstat (limited to 'http.c')
| -rw-r--r-- | http.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -4,7 +4,6 @@ #include <dynstr.h> #include <sys/types.h> #include <unistd.h> -#include <ctype.h> #include <errno.h> #include <inttypes.h> #include <stdbool.h> @@ -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); |
