repo.or.cz
/
unleashed.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix NULL pointer constant issues in lib/libc
[unleashed.git]
/
bin
/
pax
/
dprintf.c
blob
165d5f60bfcafe7280322029be181eea6eb66dcf
1
#include <stdio.h>
2
#include <stdarg.h>
3
#include <stdlib.h>
4
5
int
6
dprintf
(
int
fd
,
const char
*
fmt
, ...)
7
{
8
char
*
s
=
NULL
;
9
va_list
ap
;
10
int
ret
;
11
12
va_start
(
ap
,
fmt
);
13
ret
=
vasprintf
(&
s
,
fmt
,
ap
);
14
va_end
(
ap
);
15
if
(
ret
<
0
)
16
return
ret
;
17
ret
=
write
(
fd
,
s
,
ret
);
18
free
(
s
);
19
return
ret
;
20
}