Codebase list fgetty / lintian-fixes/main fmt_ulong.c
lintian-fixes/main

Tree @lintian-fixes/main (Download .tar.gz)

fmt_ulong.c @lintian-fixes/mainraw · history · blame

#include "fmt.h"

unsigned int fmt_ulong(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;
}