rsc | a84cbb2 | 2004-04-19 19:29:25 +0000 | [diff] [blame] | 1 | #include <u.h> |
2 | #include <libc.h> | ||||
3 | #include <bio.h> | ||||
4 | #include <mach.h> | ||||
5 | |||||
6 | char * | ||||
7 | _hexify(char *buf, ulong p, int zeros) | ||||
8 | { | ||||
9 | ulong d; | ||||
10 | |||||
11 | d = p/16; | ||||
12 | if(d) | ||||
13 | buf = _hexify(buf, d, zeros-1); | ||||
14 | else | ||||
15 | while(zeros--) | ||||
16 | *buf++ = '0'; | ||||
17 | *buf++ = "0123456789abcdef"[p&0x0f]; | ||||
18 | return buf; | ||||
19 | } | ||||
20 |