|
|
@ -9,7 +9,9 @@ unsigned int fmt_xlong(char *dest,unsigned long i) {
|
|
|
|
/* first count the number of bytes needed */
|
|
|
|
/* first count the number of bytes needed */
|
|
|
|
for (len=1, tmp=i; tmp>15; ++len) tmp>>=4;
|
|
|
|
for (len=1, tmp=i; tmp>15; ++len) tmp>>=4;
|
|
|
|
if (dest)
|
|
|
|
if (dest)
|
|
|
|
for (tmp=i, dest+=len; tmp; tmp>>=4)
|
|
|
|
for (tmp=i, dest+=len; ; ) {
|
|
|
|
*--dest = tohex(tmp&15);
|
|
|
|
*--dest = tohex(tmp&15);
|
|
|
|
|
|
|
|
if (!(tmp>>=4)) break;
|
|
|
|
|
|
|
|
}
|
|
|
|
return len;
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
}
|
|
|
|