]> git.eshelyaron.com Git - emacs.git/commitdiff
* dbusbind.c (Fdbus_register_signal): Use sprintf + strcat instead
authorMichael Albinus <michael.albinus@gmx.de>
Mon, 21 Jul 2008 04:28:50 +0000 (04:28 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Mon, 21 Jul 2008 04:28:50 +0000 (04:28 +0000)
only sprintf.

src/ChangeLog
src/dbusbind.c

index 93b10920f4809f34a89ab8365eaa328bef25c326..a1c1a16fc048f7775f8e46b069b385a95f546dc5 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-21  Michael Albinus  <michael.albinus@gmx.de>
+
+       * dbusbind.c (Fdbus_register_signal): Use sprintf + strcat instead
+       only sprintf.
+
 2008-07-21  Kenichi Handa  <handa@m17n.org>
 
        * ftfont.c (adjust_anchor): Check if DetalValue is not NULL.
index c59f2f5cfea5cc99c87fccdbb552ce006238607a..eec91c00b4ad92728793dd7bac09215cfa8950ce 100644 (file)
@@ -1314,6 +1314,7 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
   DBusConnection *connection;
   int i;
   char rule[DBUS_MAXIMUM_MATCH_RULE_LENGTH];
+  char x[DBUS_MAXIMUM_MATCH_RULE_LENGTH];
   DBusError derror;
 
   /* Check parameters.  */
@@ -1366,17 +1367,24 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
 
       /* Add unique name and path to the rule if they are non-nil.  */
       if (!NILP (uname))
-       sprintf (rule, "%s,sender='%s'", rule, SDATA (uname));
+       {
+         sprintf (x, ",sender='%s'", SDATA (uname));
+         strcat (rule, x);
+       }
 
       if (!NILP (path))
-       sprintf (rule, "%s,path='%s'", rule, SDATA (path));
+       {
+         sprintf (x, ",path='%s'", SDATA (path));
+         strcat (rule, x);
+       }
 
       /* Add arguments to the rule if they are non-nil.  */
       for (i = 6; i < nargs; ++i)
        if (!NILP (args[i]))
          {
            CHECK_STRING (args[i]);
-           sprintf (rule, "%s,arg%d='%s'", rule, i-6, SDATA (args[i]));
+           sprintf (x, ",arg%d='%s'", i-6, SDATA (args[i]));
+           strcat (rule, x);
          }
 
       /* Add the rule to the bus.  */