From 35e8a7b8864eb9c0badadd4f1699b8e01a4b4d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Wed, 18 Jan 2006 13:22:11 +0000 Subject: [PATCH] (heim_integer_cmp): make it work with negative numbers. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16580 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/asn1/der_cmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/asn1/der_cmp.c b/lib/asn1/der_cmp.c index 306fcbdf5..2471312ba 100644 --- a/lib/asn1/der_cmp.c +++ b/lib/asn1/der_cmp.c @@ -74,10 +74,10 @@ heim_bit_string_cmp(const heim_bit_string *p, const heim_bit_string *q) int heim_integer_cmp(const heim_integer *p, const heim_integer *q) { + if (p->negative != q->negative) + return q->negative - p->negative; if (p->length != q->length) return p->length - q->length; - if (p->negative != q->negative) - return p->negative - q->negative; return memcmp(p->data, q->data, p->length); }