diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-09-11 21:32:08 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:18:24 -0500 |
commit | ac3e41af378cc7a462b5731473909bca3c841d42 (patch) | |
tree | 94fb954df0bf4951a712e8db4920e83cdb04c7a8 /source4/lib/replace/snprintf.c | |
parent | 513568b7e2da1fe3ba26fb02228d616b453112ea (diff) | |
download | samba-ac3e41af378cc7a462b5731473909bca3c841d42.tar.gz samba-ac3e41af378cc7a462b5731473909bca3c841d42.tar.bz2 samba-ac3e41af378cc7a462b5731473909bca3c841d42.zip |
r18401: some of our code also relies on fprintf() handling C99
semantics. Easiest to just replace it if it doesn't.
(This used to be commit 5fc756a770b6f457bf103e2a8a240ca020fd1a02)
Diffstat (limited to 'source4/lib/replace/snprintf.c')
-rw-r--r-- | source4/lib/replace/snprintf.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source4/lib/replace/snprintf.c b/source4/lib/replace/snprintf.c index 93285a5e57..b38d8dad34 100644 --- a/source4/lib/replace/snprintf.c +++ b/source4/lib/replace/snprintf.c @@ -1230,6 +1230,27 @@ static int add_cnk_list_entry(struct pr_chunk_x **list, } #endif +#ifndef HAVE_C99_VSNPRINTF + int fprintf(FILE *stream, const char *fmt, ...) +{ + va_list ap; + int ret; + char *s; + + s = NULL; + va_start(ap, fmt); + ret = vasprintf(&s, fmt, ap); + va_end(ap); + + if (s) { + fwrite(s, 1, strlen(s), stream); + } + free(s); + + return ret; +} +#endif + #endif #ifndef HAVE_VASPRINTF |