From 1c478c73e8ec1b106d1f7ee43097985a9b4dd370 Mon Sep 17 00:00:00 2001 From: JayPiKay Date: Mon, 16 Aug 2021 14:21:31 +0200 Subject: [PATCH] Using uint8_t for buffers instead of char --- main.c | 4 ++-- usbms.c | 2 +- usbms.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index c1d50ea..c8ea9b7 100644 --- a/main.c +++ b/main.c @@ -34,7 +34,7 @@ static int setpassword(const char *password) } } printf("Updating password to `%s'... ", password); - if (send_command(ACTIONPRO_OPCODE_SETPASSWORD, password, slen) == ACTIONPRO_CMD_OK) + if (send_command(ACTIONPRO_OPCODE_SETPASSWORD, (const uint8_t *)password, slen) == ACTIONPRO_CMD_OK) printf("OK\n"); else printf("ERROR\n"); @@ -61,7 +61,7 @@ static int setssid(const char *ssid) } } printf("Updating SSID to `%s'... ", ssid); - if (send_command(ACTIONPRO_OPCODE_SETSSID, ssid, slen) == ACTIONPRO_CMD_OK) + if (send_command(ACTIONPRO_OPCODE_SETSSID, (const uint8_t *)ssid, slen) == ACTIONPRO_CMD_OK) printf("OK\n"); else printf("ERROR\n"); diff --git a/usbms.c b/usbms.c index 5a8049c..3eeaf60 100644 --- a/usbms.c +++ b/usbms.c @@ -34,7 +34,7 @@ static struct libusb_device_handle *handle = NULL; -int send_command(const uint8_t opcode, const char *buf, const uint8_t buflen) +int send_command(const uint8_t opcode, const uint8_t *buf, const uint8_t buflen) { int rc; uint32_t expected_tag = 0; diff --git a/usbms.h b/usbms.h index 7e2abfa..2b780cb 100644 --- a/usbms.h +++ b/usbms.h @@ -27,6 +27,6 @@ /* exported functions */ extern int open_device(); extern int close_device(); -extern int send_command(const uint8_t opcode, const char *buf, const uint8_t buflen); +extern int send_command(const uint8_t opcode, const uint8_t *buf, const uint8_t buflen); #endif /* usbms_h */