(length_int): handle the case of the largest negative integer by not

calling abs


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6468 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-07-15 17:15:58 +00:00
parent e89c2166db
commit f95c0bd7d1

View File

@@ -59,11 +59,11 @@ length_int (int val)
if (val == 0)
return 1;
while (abs(val) > 255) {
while (val > 255 || val < -255) {
++ret;
val /= 256;
}
if (abs(val) > 0) {
if (val != 0) {
++ret;
if ((signed char)val != val)
++ret;