Logo Search packages:      
Sourcecode: fastforward version File versions  Download package

fmt_ulong.c

#include "fmt.h"

unsigned int fmt_ulong(s,u) register char *s; register unsigned long u;
{
  register unsigned int len; register unsigned long q;
  len = 1; q = u;
  while (q > 9) { ++len; q /= 10; }
  if (s) {
    s += len;
    do { *--s = '0' + (u % 10); u /= 10; } while(u); /* handles u == 0 */
  }
  return len;
}

Generated by  Doxygen 1.6.0   Back to index