mirror of
https://github.com/mirror/wget.git
synced 2025-01-03 00:40:28 +08:00
* src/http.c (request_set_user_header): Remove use of alloca
This commit is contained in:
parent
f1ce7f5bd6
commit
a3f2ba708d
13
src/http.c
13
src/http.c
@ -280,15 +280,18 @@ request_set_header (struct request *req, const char *name, const char *value,
|
||||
static void
|
||||
request_set_user_header (struct request *req, const char *header)
|
||||
{
|
||||
char *name;
|
||||
const char *p = strchr (header, ':');
|
||||
if (!p)
|
||||
const char *name, *p;
|
||||
|
||||
if (!(p = strchr (header, ':')))
|
||||
return;
|
||||
BOUNDED_TO_ALLOCA (header, p, name);
|
||||
|
||||
name = xstrndup(header, p - header);
|
||||
|
||||
++p;
|
||||
while (c_isspace (*p))
|
||||
++p;
|
||||
request_set_header (req, xstrdup (name), (char *) p, rel_name);
|
||||
|
||||
request_set_header (req, name, (char *) p, rel_name);
|
||||
}
|
||||
|
||||
/* Remove the header with specified name from REQ. Returns true if
|
||||
|
Loading…
Reference in New Issue
Block a user