mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-24 07:16:43 +00:00
Fix empty-string tests on char[]
Caused compiler errors, thanks to Jonas Höchst for reporting.
This commit is contained in:
parent
404cc1476d
commit
e770998372
@ -1186,9 +1186,7 @@ static int http_request_start_body(struct http_request *r)
|
|||||||
if ( strcmp(r->request_header.content_type.type, "multipart") == 0
|
if ( strcmp(r->request_header.content_type.type, "multipart") == 0
|
||||||
&& strcmp(r->request_header.content_type.subtype, "form-data") == 0
|
&& strcmp(r->request_header.content_type.subtype, "form-data") == 0
|
||||||
) {
|
) {
|
||||||
if ( r->request_header.content_type.multipart_boundary == NULL
|
if (r->request_header.content_type.multipart_boundary[0] == '\0') {
|
||||||
|| r->request_header.content_type.multipart_boundary[0] == '\0'
|
|
||||||
) {
|
|
||||||
IDEBUGF(r->debug, "Malformed HTTP %s request: Content-Type %s/%s missing boundary parameter",
|
IDEBUGF(r->debug, "Malformed HTTP %s request: Content-Type %s/%s missing boundary parameter",
|
||||||
r->verb, r->request_header.content_type.type, r->request_header.content_type.subtype);
|
r->verb, r->request_header.content_type.type, r->request_header.content_type.subtype);
|
||||||
return 400;
|
return 400;
|
||||||
|
@ -936,15 +936,15 @@ strbuf strbuf_append_mime_content_type(strbuf sb, const struct mime_content_type
|
|||||||
strbuf_puts(sb, ct->type);
|
strbuf_puts(sb, ct->type);
|
||||||
strbuf_putc(sb, '/');
|
strbuf_putc(sb, '/');
|
||||||
strbuf_puts(sb, ct->subtype);
|
strbuf_puts(sb, ct->subtype);
|
||||||
if (ct->charset) {
|
if (ct->charset[0]) {
|
||||||
strbuf_puts(sb, "; charset=");
|
strbuf_puts(sb, "; charset=");
|
||||||
strbuf_append_quoted_string(sb, ct->charset);
|
strbuf_append_quoted_string(sb, ct->charset);
|
||||||
}
|
}
|
||||||
if (ct->multipart_boundary) {
|
if (ct->multipart_boundary[0]) {
|
||||||
strbuf_puts(sb, "; boundary=");
|
strbuf_puts(sb, "; boundary=");
|
||||||
strbuf_append_quoted_string(sb, ct->multipart_boundary);
|
strbuf_append_quoted_string(sb, ct->multipart_boundary);
|
||||||
}
|
}
|
||||||
if (ct->format) {
|
if (ct->format[0]) {
|
||||||
strbuf_puts(sb, "; format=");
|
strbuf_puts(sb, "; format=");
|
||||||
strbuf_append_quoted_string(sb, ct->format);
|
strbuf_append_quoted_string(sb, ct->format);
|
||||||
}
|
}
|
||||||
@ -954,11 +954,11 @@ strbuf strbuf_append_mime_content_type(strbuf sb, const struct mime_content_type
|
|||||||
strbuf strbuf_append_mime_content_disposition(strbuf sb, const struct mime_content_disposition *cd)
|
strbuf strbuf_append_mime_content_disposition(strbuf sb, const struct mime_content_disposition *cd)
|
||||||
{
|
{
|
||||||
strbuf_puts(sb, cd->type);
|
strbuf_puts(sb, cd->type);
|
||||||
if (cd->name) {
|
if (cd->name[0]) {
|
||||||
strbuf_puts(sb, "; name=");
|
strbuf_puts(sb, "; name=");
|
||||||
strbuf_append_quoted_string(sb, cd->name);
|
strbuf_append_quoted_string(sb, cd->name);
|
||||||
}
|
}
|
||||||
if (cd->filename) {
|
if (cd->filename[0]) {
|
||||||
strbuf_puts(sb, "; filename=");
|
strbuf_puts(sb, "; filename=");
|
||||||
strbuf_append_quoted_string(sb, cd->filename);
|
strbuf_append_quoted_string(sb, cd->filename);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user