mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-07 10:00:19 +01:00
* 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:
parent
759fa115c9
commit
7bb2361e65
4 changed files with 28 additions and 3 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue