Switch the order of the argument checks to avoid the
-Wduplicated-branches warning.
Signed-off-by: David King <dking@redhat.com>
Reviewed-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit
c0bf0d185d72e20e70da9a98e13f69e19f2a87d5)
}
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 */
{