libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 7c89f644a15e361fc487523e9fb7a8921726aee7
parent e815956b7b8e4889c8e290e3a1c3197c664d4bb7
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 14 Aug 2012 18:37:27 +0000

need to use must copy, as page is on the stack

Diffstat:
Mdoc/examples/largepost.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c @@ -55,7 +55,7 @@ send_page (struct MHD_Connection *connection, const char *page, response = MHD_create_response_from_buffer (strlen (page), (void *) page, - MHD_RESPMEM_PERSISTENT); + MHD_RESPMEM_MUST_COPY); if (!response) return MHD_NO; 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, { char buffer[1024]; - sprintf (buffer, askpage, nr_of_uploading_clients); + snprintf (buffer, sizeof (buffer), askpage, nr_of_uploading_clients); return send_page (connection, buffer, MHD_HTTP_OK); }