http_message_add_headers: make argument num_headers unsigned
and remove signed vs. unsigned comparison warnings. Michael
This commit is contained in:
parent
f99edadc92
commit
1052502b63
@ -188,18 +188,16 @@ http_message_set_body (http_message_t msg, const char *body, size_t len)
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
http_message_add_headers (http_message_t msg, const char **headers,
|
http_message_add_headers (http_message_t msg, const char **headers,
|
||||||
int num_headers)
|
unsigned int num_headers)
|
||||||
{
|
{
|
||||||
const char **new_headers;
|
const char **new_headers;
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
/* Check for valid arguments */
|
/* Check for valid arguments */
|
||||||
if (msg == NULL)
|
if (msg == NULL)
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
if (headers == NULL)
|
if (headers == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (num_headers < 1)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the number of headers to add is greater than the space
|
* If the number of headers to add is greater than the space
|
||||||
|
@ -88,6 +88,7 @@ extern int http_message_set_response (http_message_t msg,
|
|||||||
* sent.
|
* sent.
|
||||||
*/
|
*/
|
||||||
extern int http_message_add_headers (http_message_t msg,
|
extern int http_message_add_headers (http_message_t msg,
|
||||||
const char **headers, int num_headers);
|
const char **headers,
|
||||||
|
unsigned int num_headers);
|
||||||
|
|
||||||
#endif /* _TINYPROXY_HTTP_MESSAGE_H_ */
|
#endif /* _TINYPROXY_HTTP_MESSAGE_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user