* dbus/dbus-sysdeps.h:

* dbus/dbus-sysdeps.c:
  add _dbus_printf_length (patch from Peter Kümmel
  <syntheticpp at gmx dot net>)
This commit is contained in:
John (J5) Palmieri 2006-08-08 20:59:26 +00:00
parent 759fa115c9
commit 7bb2361e65
4 changed files with 28 additions and 3 deletions

View file

@ -1,9 +1,16 @@
2006-08-08 John (J5) Palmieri <johnp@redhat.com>
* dbus/dbus-sysdeps.h:
* dbus/dbus-sysdeps.c:
add _dbus_printf_length (patch from Peter Kümmel
<syntheticpp at gmx dot net>)
2006-08-08 John (J5) Palmieri <johnp@redhat.com>
* dbus/dbus-internals.c: unistd.h is not used
(_dbus_verbose_real): only enable verbose printing
if DBUS_VERBOSE environment var is set to '1'
(patch from Peter Kümmel <syntheticpp at gmx dot net>
(patch from Peter Kümmel <syntheticpp at gmx dot net>)
2006-08-08 John (J5) Palmieri <johnp@redhat.com>

View file

@ -1193,7 +1193,6 @@ _dbus_string_append_printf_valist (DBusString *str,
va_list args)
{
int len;
char c;
va_list args_copy;
DBUS_STRING_PREAMBLE (str);
@ -1201,7 +1200,7 @@ _dbus_string_append_printf_valist (DBusString *str,
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))
{

View file

@ -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 */

View file

@ -272,6 +272,10 @@ void _dbus_fd_set_close_on_exec (int fd);
void _dbus_exit (int code) _DBUS_GNUC_NORETURN;
int _dbus_printf_length (const char *format,
va_list args);
/**
* Portable struct with stat() results
*/