]> git.eshelyaron.com Git - emacs.git/commitdiff
Simplify xd_signature to pacify GCC 9
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 30 May 2019 22:06:39 +0000 (15:06 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 30 May 2019 22:29:50 +0000 (15:29 -0700)
* src/dbusbind.c (xd_signature): Use simpler way to set up
the subsignature.  This also pacifies GCC 9 on Fedora 30 x86-64.
Backport from master.

src/dbusbind.c

index 6ae9bc7f538605d71533424138c884a9a026dec2..fcb58f744895e674f3460fbaa0da93d44b848272 100644 (file)
@@ -346,7 +346,6 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object)
   int subtype;
   Lisp_Object elt;
   char const *subsig;
-  int subsiglen;
   char x[DBUS_MAXIMUM_SIGNATURE_LENGTH];
 
   elt = object;
@@ -428,10 +427,9 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object)
          elt = CDR_SAFE (XD_NEXT_VALUE (elt));
        }
 
-      subsiglen = snprintf (signature, DBUS_MAXIMUM_SIGNATURE_LENGTH,
-                           "%c%s", dtype, subsig);
-      if (! (0 <= subsiglen && subsiglen < DBUS_MAXIMUM_SIGNATURE_LENGTH))
-       string_overflow ();
+      signature[0] = dtype;
+      signature[1] = '\0';
+      xd_signature_cat (signature, subsig);
       break;
 
     case DBUS_TYPE_VARIANT: