From 01e01bf6af25be1380ba004d62dd9ce94a445bc1 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Thu, 17 May 2012 15:19:59 -0300 Subject: gdbus: do not call memset for terminating NUL --- gdbus/object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gdbus') diff --git a/gdbus/object.c b/gdbus/object.c index 7a941562..e378074e 100644 --- a/gdbus/object.c +++ b/gdbus/object.c @@ -72,7 +72,6 @@ static void print_arguments(GString *gstr, const char *sig, complete = FALSE; struct_level = dict_level = 0; - memset(type, 0, sizeof(type)); /* Gather enough data to have a single complete type */ for (len = 0; len < (sizeof(type) - 1) && sig[i]; len++, i++) { @@ -107,6 +106,8 @@ static void print_arguments(GString *gstr, const char *sig, break; } + type[len + 1] = '\0'; + if (!complete) { error("Unexpected signature: %s", sig); return; -- cgit v1.2.3