Skip to content

Commit 9191f65

Browse files
mjclukash
authored andcommitted
Improve truncated command diagnostics
1 parent 99c2942 commit 9191f65

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/main.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,14 +2394,14 @@ static void cmd_info(const Data *d, unsigned char *buf, int len) {
23942394
static void on_command_received(unsigned char *buffer, unsigned int len) {
23952395
Data *d = (Data *) ARG;
23962396
if (len < 2) {
2397-
log_error("Received command data too short.");
2397+
log_error("Received command data too short: %u bytes.", len);
23982398
return;
23992399
}
24002400

24012401
uint8_t magicnr = buffer[0];
24022402
uint8_t command = buffer[1];
24032403
if (magicnr != 101) {
2404-
log_error("Invalid Package ID: %u", magicnr);
2404+
log_error("Invalid Package ID: %u", (unsigned) magicnr);
24052405
return;
24062406
}
24072407

0 commit comments

Comments
 (0)