From b15f847ef22ccfde3482c4111f7c2b7a99d79d2c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 6 Nov 2017 18:41:40 +0000 Subject: [PATCH 1/6] _DBUS_STRING_DEFINE_STATIC: Don't include zero termination in length _dbus_string_init_const() doesn't include the trailing '\0' in the DBusRealString->len, so this surely shouldn't either. In practice none of the users of _DBUS_STRING_DEFINE_STATIC care one way or the other, but it seems better to be consistent. Signed-off-by: Simon McVittie --- dbus/dbus-string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbus/dbus-string.h b/dbus/dbus-string.h index 1c017702..2f78a04c 100644 --- a/dbus/dbus-string.h +++ b/dbus/dbus-string.h @@ -402,7 +402,7 @@ _dbus_string_get_const_udata_len (const DBusString *str, int start, int len) #define _DBUS_STRING_DEFINE_STATIC(name, str) \ static const char _dbus_static_string_##name[] = str; \ static const DBusString name = { _dbus_static_string_##name, \ - sizeof(_dbus_static_string_##name), \ + sizeof(_dbus_static_string_##name) - 1, \ sizeof(_dbus_static_string_##name) + \ _DBUS_STRING_ALLOCATION_PADDING, \ TRUE, TRUE, FALSE, 0 } -- 2.15.0