bt_host_write: fix invalid check
r is uninitalised, so this check is undefined. Change it to check len
instead.
Signed-off-by: Joel Stanley <joel@jms.id.au>
diff --git a/btbridged.c b/btbridged.c
index 9dbed09..c57843d 100644
--- a/btbridged.c
+++ b/btbridged.c
@@ -361,7 +361,7 @@
memcpy(data + 5, bt_msg->rsp.data, bt_msg->rsp.data_len);
/* Count the data[0] byte */
len = write(context->fds[BT_FD].fd, data, data[0] + 1);
- if (r == -1) {
+ if (len == -1) {
r = errno;
MSG_ERR("Error writing to %s: %s\n", BT_HOST_PATH, strerror(errno));
if (bt_msg->call) {