Browse Source

fix outputting 0.

master
Felix von Leitner 21 years ago
parent
commit
4f44f5a482
  1. 4
      fmt/fmt_xlong.c

4
fmt/fmt_xlong.c

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

Loading…
Cancel
Save