Browse Source

fmt_ulong did not output '0' properly.

master
Felix von Leitner 21 years ago
parent
commit
0112bac580
  1. 1
      CHANGES
  2. 4
      fmt/fmt_ulong.c

1
CHANGES

@ -1,5 +1,6 @@
0.6:
changed name to libowfat
fixed fmt_ulong (did not output 0 correctly)
0.5:
made subdirectories for the different libraries.

4
fmt/fmt_ulong.c

@ -1,11 +1,11 @@
#include "fmt.h"
unsigned int fmt_ulong(char *dest,unsigned long i) {
register unsigned long len,tmp;
register unsigned long len,tmp,len2;
/* first count the number of bytes needed */
for (len=1, tmp=i; tmp>9; ++len) tmp/=10;
if (dest)
for (tmp=i, dest+=len; tmp; tmp/=10)
for (tmp=i, dest+=len, len2=len+1; --len2; tmp/=10)
*--dest = (tmp%10)+'0';
return len;
}
Loading…
Cancel
Save