aboutsummaryrefslogtreecommitdiffstats
path: root/src/dbusbind.c
diff options
context:
space:
mode:
authorMichael Albinus2008-07-21 04:28:50 +0000
committerMichael Albinus2008-07-21 04:28:50 +0000
commitc0894fb9cbd8472cda39fdbf2125e7cd921df183 (patch)
tree342bd1c9db6aeaa644c1eae37168e9ef996894de /src/dbusbind.c
parent383f1f54c9e98b589d24a81e2ebb7136d19dfb3a (diff)
downloademacs-c0894fb9cbd8472cda39fdbf2125e7cd921df183.tar.gz
emacs-c0894fb9cbd8472cda39fdbf2125e7cd921df183.zip
* dbusbind.c (Fdbus_register_signal): Use sprintf + strcat instead
only sprintf.
Diffstat (limited to 'src/dbusbind.c')
-rw-r--r--src/dbusbind.c14
1 files changed, 11 insertions, 3 deletions
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
1314 DBusConnection *connection; 1314 DBusConnection *connection;
1315 int i; 1315 int i;
1316 char rule[DBUS_MAXIMUM_MATCH_RULE_LENGTH]; 1316 char rule[DBUS_MAXIMUM_MATCH_RULE_LENGTH];
1317 char x[DBUS_MAXIMUM_MATCH_RULE_LENGTH];
1317 DBusError derror; 1318 DBusError derror;
1318 1319
1319 /* Check parameters. */ 1320 /* Check parameters. */
@@ -1366,17 +1367,24 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
1366 1367
1367 /* Add unique name and path to the rule if they are non-nil. */ 1368 /* Add unique name and path to the rule if they are non-nil. */
1368 if (!NILP (uname)) 1369 if (!NILP (uname))
1369 sprintf (rule, "%s,sender='%s'", rule, SDATA (uname)); 1370 {
1371 sprintf (x, ",sender='%s'", SDATA (uname));
1372 strcat (rule, x);
1373 }
1370 1374
1371 if (!NILP (path)) 1375 if (!NILP (path))
1372 sprintf (rule, "%s,path='%s'", rule, SDATA (path)); 1376 {
1377 sprintf (x, ",path='%s'", SDATA (path));
1378 strcat (rule, x);
1379 }
1373 1380
1374 /* Add arguments to the rule if they are non-nil. */ 1381 /* Add arguments to the rule if they are non-nil. */
1375 for (i = 6; i < nargs; ++i) 1382 for (i = 6; i < nargs; ++i)
1376 if (!NILP (args[i])) 1383 if (!NILP (args[i]))
1377 { 1384 {
1378 CHECK_STRING (args[i]); 1385 CHECK_STRING (args[i]);
1379 sprintf (rule, "%s,arg%d='%s'", rule, i-6, SDATA (args[i])); 1386 sprintf (x, ",arg%d='%s'", i-6, SDATA (args[i]));
1387 strcat (rule, x);
1380 } 1388 }
1381 1389
1382 /* Add the rule to the bus. */ 1390 /* Add the rule to the bus. */