OSDN Git Service

Fix pattern matching logic on Manager.FindAdapter.
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>
Wed, 1 Apr 2009 13:19:46 +0000 (10:19 -0300)
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>
Wed, 1 Apr 2009 14:59:51 +0000 (11:59 -0300)
Missing else if where causing dev_id to be overwrite in case of "any" or
"00:00:00:00:00:00" patterns.

src/manager.c

index a488364..4ba016d 100644 (file)
@@ -196,7 +196,7 @@ static DBusMessage *find_adapter(DBusConnection *conn,
                if (path != NULL)
                        goto done;
                dev_id = -1;
-       } if (!strncmp(pattern, "hci", 3) && strlen(pattern) >= 4)
+       } else if (!strncmp(pattern, "hci", 3) && strlen(pattern) >= 4)
                dev_id = atoi(pattern + 3);
        else
                dev_id = find_by_address(pattern);