diff options
author | Patrick Monnerat <patrick@monnerat.net> | 2017-09-22 01:08:29 +0100 |
---|---|---|
committer | Patrick Monnerat <patrick@monnerat.net> | 2017-09-22 01:08:29 +0100 |
commit | ee56fdb6910f6bf215eecede9e2e9bfc83cb5f29 (patch) | |
tree | bfdbf1f3f2f5cd9f051f6b8d0b2469c51b2660ef /docs/examples | |
parent | fa9482ab0907dfacd0fb619add2dbf41de2d8c9c (diff) | |
download | curl-ee56fdb6910f6bf215eecede9e2e9bfc83cb5f29.tar.gz |
form/mime: field names are not allowed to contain zero-valued bytes.
Also suppress length argument of curl_mime_name() (names are always
zero-terminated).
Diffstat (limited to 'docs/examples')
-rw-r--r-- | docs/examples/multi-post.c | 6 | ||||
-rw-r--r-- | docs/examples/postit2.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/docs/examples/multi-post.c b/docs/examples/multi-post.c index 93c78e98d..95d71bea9 100644 --- a/docs/examples/multi-post.c +++ b/docs/examples/multi-post.c @@ -51,17 +51,17 @@ int main(void) /* Fill in the file upload field */ field = curl_mime_addpart(form); - curl_mime_name(field, "sendfile", CURL_ZERO_TERMINATED); + curl_mime_name(field, "sendfile"); curl_mime_filedata(field, "multi-post.c"); /* Fill in the filename field */ field = curl_mime_addpart(form); - curl_mime_name(field, "filename", CURL_ZERO_TERMINATED); + curl_mime_name(field, "filename"); curl_mime_data(field, "multi-post.c", CURL_ZERO_TERMINATED); /* Fill in the submit field too, even if this is rarely needed */ field = curl_mime_addpart(form); - curl_mime_name(field, "submit", CURL_ZERO_TERMINATED); + curl_mime_name(field, "submit"); curl_mime_data(field, "send", CURL_ZERO_TERMINATED); /* initialize custom header list (stating that Expect: 100-continue is not diff --git a/docs/examples/postit2.c b/docs/examples/postit2.c index ca5c77dc4..49391e1cd 100644 --- a/docs/examples/postit2.c +++ b/docs/examples/postit2.c @@ -61,17 +61,17 @@ int main(int argc, char *argv[]) /* Fill in the file upload field */ field = curl_mime_addpart(form); - curl_mime_name(field, "sendfile", CURL_ZERO_TERMINATED); + curl_mime_name(field, "sendfile"); curl_mime_filedata(field, "postit2.c"); /* Fill in the filename field */ field = curl_mime_addpart(form); - curl_mime_name(field, "filename", CURL_ZERO_TERMINATED); + curl_mime_name(field, "filename"); curl_mime_data(field, "postit2.c", CURL_ZERO_TERMINATED); /* Fill in the submit field too, even if this is rarely needed */ field = curl_mime_addpart(form); - curl_mime_name(field, "submit", CURL_ZERO_TERMINATED); + curl_mime_name(field, "submit"); curl_mime_data(field, "send", CURL_ZERO_TERMINATED); /* initialize custom header list (stating that Expect: 100-continue is not |