Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
354 B

  1. #include "fmt.h"
  2. size_t fmt_8longlong(char *dest,unsigned long long i) {
  3. register unsigned long len;
  4. unsigned long long tmp;
  5. /* first count the number of bytes needed */
  6. for (len=1, tmp=i; tmp>7; ++len) tmp>>=3;
  7. if (dest)
  8. for (tmp=i, dest+=len; ; ) {
  9. *--dest = (char)((tmp&7)+'0');
  10. if (!(tmp>>=3)) break;
  11. }
  12. return len;
  13. }