gdbus: do not call memset for terminating NUL
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Thu, 17 May 2012 18:19:59 +0000 (15:19 -0300)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 18 May 2012 02:57:55 +0000 (19:57 -0700)
gdbus/object.c

index 7a94156..e378074 100644 (file)
@@ -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;