s/qmail
3.3.23
Next generation secure email transport
sqmail-3.3.23
src
fmt_xlong.c
Go to the documentation of this file.
1
#include "
fmt.h
"
2
3
char
tohex
(
char
num
) {
4
if
(num<10)
5
return
num+
'0'
;
6
else
if
(num<16)
7
return
num-10+
'a'
;
8
else
9
return
-1;
10
}
11
12
unsigned
int
fmt_xlong
(
register
char
*s,
register
unsigned
long
u
)
13
{
14
register
unsigned
int
len
;
15
register
unsigned
long
q;
16
17
len = 1;
18
q =
u
;
19
while
(q > 15) { ++
len
; q /= 16; }
20
if
(s) {
21
s +=
len
;
22
do
{ *--s =
tohex
(u % 16); u /= 16; }
while
(u);
/* handles u == 0 */
23
}
24
return
len
;
25
}
fmt.h
tohex
char tohex(char num)
Definition:
fmt_xlong.c:3
len
unsigned len
Definition:
matchup.c:36
fmt_xlong
unsigned int fmt_xlong(register char *s, register unsigned long u)
Definition:
fmt_xlong.c:12
num
char num[FMT_ULONG]
Definition:
chkspawn.c:9
u
unsigned u
Definition:
matchup.c:36
Generated on Sat Jan 12 2019 23:42:27 for s/qmail by
1.8.13