From: Michael Albinus Date: Mon, 21 Jul 2008 04:28:50 +0000 (+0000) Subject: * dbusbind.c (Fdbus_register_signal): Use sprintf + strcat instead X-Git-Tag: emacs-pretest-23.0.90~4040 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c0894fb9cbd8472cda39fdbf2125e7cd921df183;p=emacs.git * dbusbind.c (Fdbus_register_signal): Use sprintf + strcat instead only sprintf. --- diff --git a/src/ChangeLog b/src/ChangeLog index 93b10920f48..a1c1a16fc04 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2008-07-21 Michael Albinus + + * dbusbind.c (Fdbus_register_signal): Use sprintf + strcat instead + only sprintf. + 2008-07-21 Kenichi Handa * ftfont.c (adjust_anchor): Check if DetalValue is not NULL. diff --git a/src/dbusbind.c b/src/dbusbind.c index c59f2f5cfea..eec91c00b4a 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c @@ -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. */