gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] branch master updated: use more c99


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated: use more c99
Date: Thu, 05 Oct 2017 23:25:42 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new f8e92c1e use more c99
f8e92c1e is described below

commit f8e92c1eb9d56a41b5461d9a54bbc1b1cb76e812
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Oct 5 23:25:41 2017 +0200

    use more c99
---
 src/microhttpd/response.c | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index fa1cedf4..3a4b7e1b 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -169,7 +169,7 @@ MHD_del_response_header (struct MHD_Response *response,
     return MHD_NO;
   prev = NULL;
   pos = response->first_header;
-  while (pos != NULL)
+  while (NULL != pos)
     {
       if ((0 == strcmp (header,
                         pos->header)) &&
@@ -207,10 +207,11 @@ MHD_get_response_headers (struct MHD_Response *response,
                           MHD_KeyValueIterator iterator,
                           void *iterator_cls)
 {
-  struct MHD_HTTP_Header *pos;
   int numHeaders = 0;
 
-  for (pos = response->first_header; NULL != pos; pos = pos->next)
+  for (struct MHD_HTTP_Header *pos = response->first_header;
+       NULL != pos;
+       pos = pos->next)
     {
       numHeaders++;
       if ((NULL != iterator) &&
@@ -236,11 +237,11 @@ const char *
 MHD_get_response_header (struct MHD_Response *response,
                         const char *key)
 {
-  struct MHD_HTTP_Header *pos;
-
   if (NULL == key)
     return NULL;
-  for (pos = response->first_header; NULL != pos; pos = pos->next)
+  for (struct MHD_HTTP_Header *pos = response->first_header;
+       NULL != pos;
+       pos = pos->next)
     {
       if ( MHD_str_equal_caseless_ (pos->header, key) )
         return pos->value;
@@ -253,6 +254,7 @@ MHD_get_response_header (struct MHD_Response *response,
  *
  * Token could be surrounded by spaces and tabs and delimited by comma.
  * Case-insensitive match used for header names and tokens.
+ *
  * @param response  the response to query
  * @param key       header name
  * @param token     the token to find
@@ -267,16 +269,22 @@ MHD_check_response_header_token_ci (const struct 
MHD_Response *response,
                                     const char *token,
                                     size_t token_len)
 {
-  struct MHD_HTTP_Header *pos;
-
-  if (NULL == key || 0 == key[0] || NULL == token || 0 == token[0])
+  if ( (NULL == key) ||
+       ('\0' == key[0]) ||
+       (NULL == token) ||
+       ('\0' == token[0]) )
     return false;
 
-  for (pos = response->first_header; NULL != pos; pos = pos->next)
+  for (struct MHD_HTTP_Header *pos = response->first_header;
+       NULL != pos;
+       pos = pos->next)
     {
       if ( (pos->kind == MHD_HEADER_KIND) &&
-           MHD_str_equal_caseless_ (pos->header, key) &&
-           MHD_str_has_token_caseless_ (pos->value, token, token_len) )
+           MHD_str_equal_caseless_ (pos->header,
+                                    key) &&
+           MHD_str_has_token_caseless_ (pos->value,
+                                        token,
+                                        token_len) )
         return true;
     }
   return false;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]