aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-06-22 15:16:11 +0200
committerChristian Grothoff <christian@grothoff.org>2018-06-22 15:16:11 +0200
commit832739556b765571f80520b91bdad5f14f6aa1b4 (patch)
tree79a7bf9a1c523466a3919a3c862426f17369a924 /doc
parent65a322cfe842d6028a0b27bc114b34ea178903eb (diff)
downloadlibmicrohttpd-832739556b765571f80520b91bdad5f14f6aa1b4.tar.gz
libmicrohttpd-832739556b765571f80520b91bdad5f14f6aa1b4.zip
some minor code cleaning issues
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/tlsauthentication.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/doc/examples/tlsauthentication.c b/doc/examples/tlsauthentication.c
index 4c512a3b..43b41bf1 100644
--- a/doc/examples/tlsauthentication.c
+++ b/doc/examples/tlsauthentication.c
@@ -33,12 +33,10 @@ string_to_base64 (const char *message)
33 char *tmp; 33 char *tmp;
34 size_t length = strlen (message); 34 size_t length = strlen (message);
35 35
36 tmp = malloc (length * 2); 36 tmp = malloc (length * 2 + 1);
37 if (NULL == tmp) 37 if (NULL == tmp)
38 return tmp; 38 return NULL;
39
40 tmp[0] = 0; 39 tmp[0] = 0;
41
42 for (i = 0; i < length; i += 3) 40 for (i = 0; i < length; i += 3)
43 { 41 {
44 l = (((unsigned long) message[i]) << 16) 42 l = (((unsigned long) message[i]) << 16)
@@ -169,7 +167,7 @@ is_authenticated (struct MHD_Connection *connection,
169 const char *strbase = "Basic "; 167 const char *strbase = "Basic ";
170 int authenticated; 168 int authenticated;
171 size_t slen; 169 size_t slen;
172 170
173 headervalue = 171 headervalue =
174 MHD_lookup_connection_value (connection, MHD_HEADER_KIND, 172 MHD_lookup_connection_value (connection, MHD_HEADER_KIND,
175 "Authorization"); 173 "Authorization");