Commit 2fb62561 authored by David King's avatar David King Committed by Simon McVittie

dbus-send: Avoid duplicated-branches warning

Switch the order of the argument checks to avoid the
-Wduplicated-branches warning.
Signed-off-by: 's avatarDavid King <dking@redhat.com>
Reviewed-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
(cherry picked from commit c0bf0d18)
parent 2e4a72ed
......@@ -289,13 +289,16 @@ main (int argc, char *argv[])
}
else if ((strstr (arg, "--bus=") == arg) || (strstr (arg, "--peer=") == arg) || (strstr (arg, "--address=") == arg))
{
if (arg[2] == 'b') /* bus */
/* Check for peer first, to avoid the GCC -Wduplicated-branches
* warning.
*/
if (arg[2] == 'p') /* peer */
{
is_bus = TRUE;
is_bus = FALSE;
}
else if (arg[2] == 'p') /* peer */
else if (arg[2] == 'b') /* bus */
{
is_bus = FALSE;
is_bus = TRUE;
}
else /* address; keeping backwards compatibility */
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment