Return with error if read byte command was unsuccessful

This commit is contained in:
stefanrueger
2026-08-16 08:03:07 +02:00
parent 7322ca62e2
commit bece322a7b

View File

@@ -2999,7 +2999,14 @@ static int jtag3_read_byte_tpi(const PROGRAMMER *pgm, const AVRPART *p, const AV
if((status = jtag3_command_tpi(pgm, cmd, len, &resp, "Read Byte")) < 0)
return -1;
*value = status > 2? resp[2]: '?';
if(status < 3) {
pmsg_error("too short reply of read byte command\n");
mmt_free(resp);
return -1;
}
*value = resp[2];
mmt_free(resp);
return 0;
}