From d651e31b98932dd7b5f4545065836fe20bd1fd9f Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Fri, 19 Apr 2024 16:08:43 +0100 Subject: [PATCH] Improve usbasp_tpi_read_byte() error messaging --- src/usbasp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/usbasp.c b/src/usbasp.c index 80db2650..7c607d13 100644 --- a/src/usbasp.c +++ b/src/usbasp.c @@ -1292,9 +1292,9 @@ static int usbasp_tpi_read_byte(const PROGRAMMER * pgm, const AVRPART *p, const cmd[2] = 0; cmd[3] = 0; n = usbasp_transmit(pgm, 1, USBASP_FUNC_TPI_READBLOCK, cmd, value, 1); - if(n != 1) - { - pmsg_error("wrong reading bytes %x\n", n); + if(n != 1) { + if(n >= 0) + pmsg_error("wrong number %d of bytes read (expected 1)\n", n); return -3; } return 0;