summaryrefslogtreecommitdiffstats
path: root/source/lib/replace/snprintf.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-09-11 21:32:08 +0000
committerAndrew Tridgell <tridge@samba.org>2006-09-11 21:32:08 +0000
commitb32f6bd7358a882092798cc6970341e892d6aa33 (patch)
tree1a299b371630e44507c3b29332ebd6628274e364 /source/lib/replace/snprintf.c
parent9057132e95a48eca99ece2d2f98f6c3317c7bfa6 (diff)
downloadsamba-b32f6bd7358a882092798cc6970341e892d6aa33.tar.gz
samba-b32f6bd7358a882092798cc6970341e892d6aa33.tar.xz
samba-b32f6bd7358a882092798cc6970341e892d6aa33.zip
r18401: some of our code also relies on fprintf() handling C99
semantics. Easiest to just replace it if it doesn't.
Diffstat (limited to 'source/lib/replace/snprintf.c')
-rw-r--r--source/lib/replace/snprintf.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/lib/replace/snprintf.c b/source/lib/replace/snprintf.c
index 93285a5e570..b38d8dad34a 100644
--- a/source/lib/replace/snprintf.c
+++ b/source/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