summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hcid/dbus-common.c39
-rw-r--r--hcid/dbus-common.h2
2 files changed, 1 insertions, 40 deletions
diff --git a/hcid/dbus-common.c b/hcid/dbus-common.c
index 5e7d0888..3df3d4d1 100644
--- a/hcid/dbus-common.c
+++ b/hcid/dbus-common.c
@@ -207,45 +207,6 @@ failed:
return 0;
}
-
-int check_address(const char *addr)
-{
- char tmp[18];
- char *ptr = tmp;
-
- if (!addr)
- return -1;
-
- if (strlen(addr) != 17)
- return -1;
-
- memcpy(tmp, addr, 18);
-
- while (*ptr) {
-
- *ptr = toupper(*ptr);
- if (*ptr < '0'|| (*ptr > '9' && *ptr < 'A') || *ptr > 'F')
- return -1;
-
- ptr++;
- *ptr = toupper(*ptr);
- if (*ptr < '0'|| (*ptr > '9' && *ptr < 'A') || *ptr > 'F')
- return -1;
-
- ptr++;
- *ptr = toupper(*ptr);
- if (*ptr == 0)
- break;
-
- if (*ptr != ':')
- return -1;
-
- ptr++;
- }
-
- return 0;
-}
-
void hcid_dbus_set_experimental(void)
{
experimental = 1;
diff --git a/hcid/dbus-common.h b/hcid/dbus-common.h
index 98513ea0..d1bc1683 100644
--- a/hcid/dbus-common.h
+++ b/hcid/dbus-common.h
@@ -49,7 +49,7 @@ int l2raw_connect(const char *local, const bdaddr_t *remote);
int find_conn(int s, int dev_id, long arg);
-int check_address(const char *addr);
+#define check_address(address) bachk(address)
DBusHandlerResult handle_method_call(DBusConnection *conn, DBusMessage *msg, void *data);