Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (14 sloc) 0.325 kB
/* Public domain, from daemontools-0.76. */
#include "fmt.h"
unsigned int fmt_ulong(char *s,unsigned long u)
{
unsigned int len;
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;
}
Jump to Line
Something went wrong with that request. Please try again.