From a83c7764f5b464b8eb40f20bd4b6c46dae45e5d0 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Thu, 16 Mar 2017 15:07:34 +0000 Subject: [PATCH] fix comparison, unsigned does not become negative. git-svn-id: file:///svn/unbound/trunk@4057 be551aaa-1e26-0410-a405-d3ace91eadb9 --- validator/val_anchor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/validator/val_anchor.c b/validator/val_anchor.c index bd6a0da85..2d88d4459 100644 --- a/validator/val_anchor.c +++ b/validator/val_anchor.c @@ -1277,7 +1277,11 @@ anchors_delete_insecure(struct val_anchors* anchors, uint16_t c, static int keytag_compare(const void* x, const void* y) { - return *(uint16_t*)x - *(uint16_t*)y; + if(*(uint16_t*)x == *(uint16_t*)y) + return 0; + if(*(uint16_t*)x > *(uint16_t*)y) + return 1; + return -1; } int