-simplify logic
[oweals/gnunet.git] / src / transport / test_http_common.c
index 9c619ea603a2c091893eba502e3286a7806c74b9..ace20e097d25c25a0fe315655d6e0d689caba284 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009, 2010 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -41,10 +41,10 @@ clean (struct SplittedHTTPAddress *addr)
 
 static int
 check (struct SplittedHTTPAddress *addr,
-       char * protocol,
-       char * host,
+       const char *protocol,
+       const char *host,
        int port,
-       char * path)
+       const char *path)
 {
   if (NULL == addr)
     return GNUNET_NO;
@@ -228,17 +228,18 @@ main (int argc, char *argv[])
   if (NULL != spa)
   {
     clean (spa);
+    spa = NULL;
     GNUNET_break (0);
   }
 
-  http_split_address ("http://");
+  spa = http_split_address ("http://");
   if (NULL != spa)
   {
     clean (spa);
     GNUNET_break (0);
   }
 
-  http_split_address ("://");
+  spa = http_split_address ("://");
   if (NULL != spa)
   {
     clean (spa);