gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r35281 - gnunet/src/hello


From: gnunet
Subject: [GNUnet-SVN] r35281 - gnunet/src/hello
Date: Wed, 18 Feb 2015 15:05:32 +0100

Author: grothoff
Date: 2015-02-18 15:05:32 +0100 (Wed, 18 Feb 2015)
New Revision: 35281

Modified:
   gnunet/src/hello/address.c
Log:
-tolerate NULL

Modified: gnunet/src/hello/address.c
===================================================================
--- gnunet/src/hello/address.c  2015-02-17 14:06:11 UTC (rev 35280)
+++ gnunet/src/hello/address.c  2015-02-18 14:05:32 UTC (rev 35281)
@@ -108,6 +108,8 @@
 struct GNUNET_HELLO_Address *
 GNUNET_HELLO_address_copy (const struct GNUNET_HELLO_Address *address)
 {
+  if (NULL == address)
+    return NULL;
   return GNUNET_HELLO_address_allocate (&address->peer,
                                         address->transport_name,
                                         address->address,
@@ -130,6 +132,13 @@
 {
   int ret;
 
+  if ( (NULL == a1) &&
+       (NULL == a2) )
+    return 0;
+  if (NULL == a1)
+    return 1;
+  if (NULL == a2)
+    return -1;
   ret = strcmp (a1->transport_name, a2->transport_name);
   if (0 != ret)
     return ret;




reply via email to

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