diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-01-24 02:09:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-01-24 02:09:43 +0000 |
commit | 0dafbfbb9588b4e7966a2a19fceedccfb477ad91 (patch) | |
tree | 92cf32ddbb0d398e9be20f6e4012e7cb8458e0d2 | |
parent | c9d38243c2990ecff32fba8f2d4e6c4427ab24af (diff) | |
download | libmicrohttpd-0dafbfbb9588b4e7966a2a19fceedccfb477ad91.tar.gz libmicrohttpd-0dafbfbb9588b4e7966a2a19fceedccfb477ad91.zip |
better
-rw-r--r-- | src/examples/querystring_example.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/examples/querystring_example.c b/src/examples/querystring_example.c index d3b53693..a44a2786 100644 --- a/src/examples/querystring_example.c +++ b/src/examples/querystring_example.c | |||
@@ -54,6 +54,8 @@ ahc_echo (void *cls, | |||
54 | *ptr = NULL; /* reset when done */ | 54 | *ptr = NULL; /* reset when done */ |
55 | val = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "q"); | 55 | val = MHD_lookup_connection_value (connection, MHD_GET_ARGUMENT_KIND, "q"); |
56 | me = malloc (snprintf (NULL, 0, fmt, "q", val) + 1); | 56 | me = malloc (snprintf (NULL, 0, fmt, "q", val) + 1); |
57 | if (me == NULL) | ||
58 | return MHD_NO; | ||
57 | sprintf (me, fmt, "q", val); | 59 | sprintf (me, fmt, "q", val); |
58 | response = MHD_create_response_from_data (strlen (me), me, MHD_YES, MHD_NO); | 60 | response = MHD_create_response_from_data (strlen (me), me, MHD_YES, MHD_NO); |
59 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); | 61 | ret = MHD_queue_response (connection, MHD_HTTP_OK, response); |