diff --git a/cmdbuf.c b/cmdbuf.c index b11bd00..b268f1f 100644 --- a/cmdbuf.c +++ b/cmdbuf.c @@ -31,7 +31,7 @@ bool cmd_match_hex_number(CommandBuf *cmd, uint32_t *value) { return true; } -bool cmd_match_hex_bytes(CommandBuf *cmd, const uint32_t count, char *value) { +bool cmd_match_hex_bytes(CommandBuf *cmd, const uint32_t count, uint8_t *value) { if (cmd->len < (count * 2)) return false; for (size_t i = 0; i < count; ++i) { char hi, lo; diff --git a/include/cmdbuf.h b/include/cmdbuf.h index 082a4e3..9bf5920 100644 --- a/include/cmdbuf.h +++ b/include/cmdbuf.h @@ -15,6 +15,6 @@ bool cmd_match_str(CommandBuf *cmd, const char *str); /* Try to consume a base-16 number, and return the value. */ bool cmd_match_hex_number(CommandBuf *cmd, uint32_t *value); /* Try to consume a hex-encoded list of bytes, and return the value. */ -bool cmd_match_hex_bytes(CommandBuf *cmd, const uint32_t count, char *value); +bool cmd_match_hex_bytes(CommandBuf *cmd, const uint32_t count, uint8_t *value); #endif \ No newline at end of file diff --git a/server.c b/server.c index f51284c..06c71cd 100644 --- a/server.c +++ b/server.c @@ -160,7 +160,7 @@ int handle_command(RdbResponse *res, CommandBuf *cmd, VB *sim, bool *running) { if (cmd_match_str(cmd, "P")) { // write a register. uint32_t reg_no; - char reg_bytes[4]; + uint8_t reg_bytes[4]; if (!cmd_match_hex_number(cmd, ®_no)) return -1; if (!cmd_match_str(cmd, "=")) return -1; if (!cmd_match_hex_bytes(cmd, 4, reg_bytes)) return -1;