From 7bb2361e657dc31ed73891f8e1ffdbfb916624c2 Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Tue, 8 Aug 2006 20:59:26 +0000 Subject: * dbus/dbus-sysdeps.h: * dbus/dbus-sysdeps.c: add _dbus_printf_length (patch from Peter Kümmel ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbus/dbus-sysdeps.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'dbus/dbus-sysdeps.c') diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index e28ea667..cd0f7cf1 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -2983,6 +2983,21 @@ _dbus_full_duplex_pipe (int *fd1, #endif } + +#ifndef DBUS_WIN +/** + * Measure the message length without terminating nul + */ +int _dbus_printf_length (const char *format, + va_list args) +{ + char c; + return vsnprintf (&c, 1, format, args); +} +#endif + + + /** @} end of sysdeps */ /* tests in dbus-sysdeps-util.c */ -- cgit