From 356038800e6bdb723f835d9a357716efeb9a8ece Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Sun, 23 Jun 2013 10:46:59 +0800 Subject: [PATCH 1/5] dbus-launch: fix coding style Signed-off-by: Chengwei Yang --- tools/dbus-launch.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tools/dbus-launch.c b/tools/dbus-launch.c index 632a004..49da17b 100644 --- a/tools/dbus-launch.c +++ b/tools/dbus-launch.c @@ -756,31 +756,31 @@ pass_info (const char *runprog, const char *bus_address, pid_t bus_pid, if (envvar == NULL || args == NULL) goto oom; - args[0] = xstrdup (runprog); - if (!args[0]) - goto oom; - for (i = 1; i <= (argc-remaining_args); i++) - { - size_t len = strlen (argv[remaining_args+i-1])+1; - args[i] = malloc (len); - if (!args[i]) + args[0] = xstrdup (runprog); + if (!args[0]) goto oom; - strncpy (args[i], argv[remaining_args+i-1], len); - } - args[i] = NULL; + for (i = 1; i <= (argc-remaining_args); i++) + { + size_t len = strlen (argv[remaining_args+i-1])+1; + args[i] = malloc (len); + if (!args[i]) + goto oom; + strncpy (args[i], argv[remaining_args+i-1], len); + } + args[i] = NULL; - strcpy (envvar, "DBUS_SESSION_BUS_ADDRESS="); - strcat (envvar, bus_address); - putenv (envvar); + strcpy (envvar, "DBUS_SESSION_BUS_ADDRESS="); + strcat (envvar, bus_address); + putenv (envvar); - execvp (runprog, args); - fprintf (stderr, "Couldn't exec %s: %s\n", runprog, strerror (errno)); - exit (1); + execvp (runprog, args); + fprintf (stderr, "Couldn't exec %s: %s\n", runprog, strerror (errno)); + exit (1); } else { print_variables (bus_address, bus_pid, bus_wid, c_shell_syntax, - bourne_shell_syntax, binary_syntax); + bourne_shell_syntax, binary_syntax); } verbose ("dbus-launch exiting\n"); -- 1.7.9.5