summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2017-09-19 21:53:52 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2017-09-19 21:53:52 +0200
commit5f4de5bf48adea1a6bf514dae9e455b046c50744 (patch)
treeb7c5eaa8f5562827d38fd64f41c4ef7c82d2643f
parent99cc8f88026f930c08e2e32439fe8f0d22e5e5a8 (diff)
downloadrockbox-5f4de5b.tar.gz
rockbox-5f4de5b.tar.bz2
rockbox-5f4de5b.zip
nwztools/scsitools: make do_fw_upgrade output less confusing
Change-Id: If616e646aeddf20aa3cee79a821a420d9102c708
-rw-r--r--utils/nwztools/scsitools/scsitool.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/utils/nwztools/scsitools/scsitool.c b/utils/nwztools/scsitools/scsitool.c
index 63a23c416d..a4aa853f46 100644
--- a/utils/nwztools/scsitools/scsitool.c
+++ b/utils/nwztools/scsitools/scsitool.c
@@ -758,9 +758,13 @@ int do_fw_upgrade(int argc, char **argv)
cprintf(GREY, "An error occured during request\n");
return ret;
}
- buffer[buffer_size] = 0;
- cprintf_field("Result:", "\n");
- print_hex(buffer, buffer_size);
+ /* the device is not supposed to send back anything but if it does, print it */
+ if(buffer_size > 0)
+ {
+ buffer[buffer_size] = 0;
+ cprintf_field("Result:", "\n");
+ print_hex(buffer, buffer_size);
+ }
return 0;
}