dbus/dbus dbus-string.c, 1.70, 1.71 dbus-sysdeps.c, 1.103,
1.104 dbus-sysdeps.h, 1.50, 1.51
John Palmieri
johnp at kemper.freedesktop.org
Tue Aug 8 13:59:28 PDT 2006
Update of /cvs/dbus/dbus/dbus
In directory kemper:/tmp/cvs-serv25766/dbus
Modified Files:
dbus-string.c dbus-sysdeps.c dbus-sysdeps.h
Log Message:
* dbus/dbus-sysdeps.h:
* dbus/dbus-sysdeps.c:
add _dbus_printf_length (patch from Peter Kümmel
<syntheticpp at gmx dot net>)
Index: dbus-string.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-string.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- dbus-string.c 3 Aug 2006 20:34:36 -0000 1.70
+++ dbus-string.c 8 Aug 2006 20:59:26 -0000 1.71
@@ -1193,7 +1193,6 @@
va_list args)
{
int len;
- char c;
va_list args_copy;
DBUS_STRING_PREAMBLE (str);
@@ -1201,7 +1200,7 @@
DBUS_VA_COPY (args_copy, args);
/* Measure the message length without terminating nul */
- len = vsnprintf (&c, 1, format, args);
+ len = _dbus_printf_length (format, args);
if (!_dbus_string_lengthen (str, len))
{
Index: dbus-sysdeps.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -d -r1.103 -r1.104
--- dbus-sysdeps.c 3 Aug 2006 20:34:36 -0000 1.103
+++ dbus-sysdeps.c 8 Aug 2006 20:59:26 -0000 1.104
@@ -2983,6 +2983,21 @@
#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 */
Index: dbus-sysdeps.h
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-sysdeps.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- dbus-sysdeps.h 3 Aug 2006 20:34:36 -0000 1.50
+++ dbus-sysdeps.h 8 Aug 2006 20:59:26 -0000 1.51
@@ -272,6 +272,10 @@
void _dbus_exit (int code) _DBUS_GNUC_NORETURN;
+int _dbus_printf_length (const char *format,
+ va_list args);
+
+
/**
* Portable struct with stat() results
*/
More information about the dbus-commit
mailing list