(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
This commit is contained in:
@@ -74,10 +74,10 @@ heim_bit_string_cmp(const heim_bit_string *p, const heim_bit_string *q)
|
|||||||
int
|
int
|
||||||
heim_integer_cmp(const heim_integer *p, const heim_integer *q)
|
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)
|
if (p->length != q->length)
|
||||||
return 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);
|
return memcmp(p->data, q->data, p->length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user