svn commit: samba r18353 - in
branches/SAMBA_4_0/source/lib/replace: .
tridge at samba.org
tridge at samba.org
Mon Sep 11 01:38:51 GMT 2006
Author: tridge
Date: 2006-09-11 01:38:50 +0000 (Mon, 11 Sep 2006)
New Revision: 18353
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18353
Log:
try to fix the assumption of NULL being handled in printf()
permanently by replacing printf() on systems that don't have a C99
printf lib
Modified:
branches/SAMBA_4_0/source/lib/replace/snprintf.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/snprintf.c
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/snprintf.c 2006-09-11 01:22:28 UTC (rev 18352)
+++ branches/SAMBA_4_0/source/lib/replace/snprintf.c 2006-09-11 01:38:50 UTC (rev 18353)
@@ -1209,6 +1209,27 @@
}
#endif
+#ifndef HAVE_C99_VSNPRINTF
+ int printf(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), stdout);
+ }
+ free(s);
+
+ return ret;
+}
+#endif
+
#endif
#ifndef HAVE_VASPRINTF
More information about the samba-cvs
mailing list