diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-08-14 18:37:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-08-14 18:37:27 +0000 |
commit | 7c89f644a15e361fc487523e9fb7a8921726aee7 (patch) | |
tree | ed44c0f87348cbd33dc13a084ef3dc86ead8a5a4 /doc | |
parent | e815956b7b8e4889c8e290e3a1c3197c664d4bb7 (diff) | |
download | libmicrohttpd-7c89f644a15e361fc487523e9fb7a8921726aee7.tar.gz libmicrohttpd-7c89f644a15e361fc487523e9fb7a8921726aee7.zip |
need to use must copy, as page is on the stack
Diffstat (limited to 'doc')
-rw-r--r-- | doc/examples/largepost.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c index 6c1c92df..15a88341 100644 --- a/doc/examples/largepost.c +++ b/doc/examples/largepost.c | |||
@@ -55,7 +55,7 @@ send_page (struct MHD_Connection *connection, const char *page, | |||
55 | 55 | ||
56 | response = | 56 | response = |
57 | MHD_create_response_from_buffer (strlen (page), (void *) page, | 57 | MHD_create_response_from_buffer (strlen (page), (void *) page, |
58 | MHD_RESPMEM_PERSISTENT); | 58 | MHD_RESPMEM_MUST_COPY); |
59 | if (!response) | 59 | if (!response) |
60 | return MHD_NO; | 60 | return MHD_NO; |
61 | MHD_add_response_header (response, MHD_HTTP_HEADER_CONTENT_TYPE, "text/html"); | 61 | MHD_add_response_header (response, MHD_HTTP_HEADER_CONTENT_TYPE, "text/html"); |
@@ -183,7 +183,7 @@ answer_to_connection (void *cls, struct MHD_Connection *connection, | |||
183 | { | 183 | { |
184 | char buffer[1024]; | 184 | char buffer[1024]; |
185 | 185 | ||
186 | sprintf (buffer, askpage, nr_of_uploading_clients); | 186 | snprintf (buffer, sizeof (buffer), askpage, nr_of_uploading_clients); |
187 | return send_page (connection, buffer, MHD_HTTP_OK); | 187 | return send_page (connection, buffer, MHD_HTTP_OK); |
188 | } | 188 | } |
189 | 189 | ||