diff options
-rw-r--r-- | src/hello/address.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/hello/address.c b/src/hello/address.c index 9b7bb2019..2d3a59121 100644 --- a/src/hello/address.c +++ b/src/hello/address.c | |||
@@ -143,12 +143,14 @@ GNUNET_HELLO_address_cmp (const struct GNUNET_HELLO_Address *a1, | |||
143 | if (0 != ret) | 143 | if (0 != ret) |
144 | return ret; | 144 | return ret; |
145 | if (a1->local_info != a2->local_info) | 145 | if (a1->local_info != a2->local_info) |
146 | return ((int) a1->local_info) - ((int) a2->local_info); | 146 | return (((int) a1->local_info) - ((int) a2->local_info) < 0) -1 : 1; |
147 | if (a1->address_length < a2->address_length) | 147 | if (a1->address_length < a2->address_length) |
148 | return -1; | 148 | return -1; |
149 | if (a1->address_length > a2->address_length) | 149 | if (a1->address_length > a2->address_length) |
150 | return 1; | 150 | return 1; |
151 | return memcmp (a1->address, a2->address, a1->address_length); | 151 | return memcmp (a1->address, |
152 | a2->address, | ||
153 | a1->address_length); | ||
152 | } | 154 | } |
153 | 155 | ||
154 | 156 | ||