[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r36465 - gnunet/src/hello
From: |
gnunet |
Subject: |
[GNUnet-SVN] r36465 - gnunet/src/hello |
Date: |
Wed, 7 Oct 2015 13:48:57 +0200 |
Author: grothoff
Date: 2015-10-07 13:48:56 +0200 (Wed, 07 Oct 2015)
New Revision: 36465
Modified:
gnunet/src/hello/address.c
Log:
-ensure result is +- 1
Modified: gnunet/src/hello/address.c
===================================================================
--- gnunet/src/hello/address.c 2015-10-07 11:31:37 UTC (rev 36464)
+++ gnunet/src/hello/address.c 2015-10-07 11:48:56 UTC (rev 36465)
@@ -143,12 +143,14 @@
if (0 != ret)
return ret;
if (a1->local_info != a2->local_info)
- return ((int) a1->local_info) - ((int) a2->local_info);
+ return (((int) a1->local_info) - ((int) a2->local_info) < 0) -1 : 1;
if (a1->address_length < a2->address_length)
return -1;
if (a1->address_length > a2->address_length)
return 1;
- return memcmp (a1->address, a2->address, a1->address_length);
+ return memcmp (a1->address,
+ a2->address,
+ a1->address_length);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r36465 - gnunet/src/hello,
gnunet <=