(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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user