mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-11 09:30:45 +01:00
2003-03-17 Havoc Pennington <hp@redhat.com>
* dbus/dbus-internals.h: add gcc attributes so that our printf-style functions warn on bad arguments to format * dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf format bug * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix printf format bug
This commit is contained in:
parent
1fbf6fa49c
commit
615fa679e1
4 changed files with 32 additions and 4 deletions
12
ChangeLog
12
ChangeLog
|
|
@ -1,3 +1,15 @@
|
|||
2003-03-17 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* dbus/dbus-internals.h: add gcc attributes so that
|
||||
our printf-style functions warn on bad arguments to
|
||||
format
|
||||
|
||||
* dbus/dbus-sysdeps.c (_dbus_connect_tcp_socket): fix printf
|
||||
format bug
|
||||
|
||||
* dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix
|
||||
printf format bug
|
||||
|
||||
2003-03-17 Havoc Pennington <hp@redhat.com>
|
||||
|
||||
* bus/test-main.c (main): make it print something as it runs
|
||||
|
|
|
|||
|
|
@ -37,10 +37,26 @@
|
|||
|
||||
DBUS_BEGIN_DECLS;
|
||||
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
||||
#define _DBUS_GNUC_PRINTF( format_idx, arg_idx ) \
|
||||
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
|
||||
#define _DBUS_GNUC_SCANF( format_idx, arg_idx ) \
|
||||
__attribute__((__format__ (__scanf__, format_idx, arg_idx)))
|
||||
#define _DBUS_GNUC_FORMAT( arg_idx ) \
|
||||
__attribute__((__format_arg__ (arg_idx)))
|
||||
#define _DBUS_GNUC_NORETURN \
|
||||
__attribute__((__noreturn__))
|
||||
#else /* !__GNUC__ */
|
||||
#define _DBUS_GNUC_PRINTF( format_idx, arg_idx )
|
||||
#define _DBUS_GNUC_SCANF( format_idx, arg_idx )
|
||||
#define _DBUS_GNUC_FORMAT( arg_idx )
|
||||
#define _DBUS_GNUC_NORETURN
|
||||
#endif /* !__GNUC__ */
|
||||
|
||||
void _dbus_warn (const char *format,
|
||||
...);
|
||||
...) _DBUS_GNUC_PRINTF (1, 2);
|
||||
void _dbus_verbose_real (const char *format,
|
||||
...);
|
||||
...) _DBUS_GNUC_PRINTF (1, 2);
|
||||
|
||||
|
||||
#ifdef DBUS_ENABLE_VERBOSE_MODE
|
||||
|
|
|
|||
|
|
@ -2771,7 +2771,7 @@ _dbus_message_loader_queue_messages (DBusMessageLoader *loader)
|
|||
|
||||
if (header_len + body_len > loader->max_message_size)
|
||||
{
|
||||
_dbus_verbose ("Message claimed length header = %d body = %d exceeds max message length %d\n",
|
||||
_dbus_verbose ("Message claimed length header = %d body = %d exceeds max message length %ld\n",
|
||||
header_len, body_len, loader->max_message_size);
|
||||
loader->corrupted = TRUE;
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -488,7 +488,7 @@ _dbus_connect_tcp_socket (const char *host,
|
|||
_dbus_result_from_errno (errno));
|
||||
|
||||
_dbus_verbose ("Failed to connect to socket %s: %s:%d\n",
|
||||
host, port, _dbus_strerror (errno));
|
||||
host, _dbus_strerror (errno), port);
|
||||
|
||||
close (fd);
|
||||
fd = -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue