From 863cf8134a4eee1826fda5143b27e394f1dacbe1 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sun, 23 Sep 2012 12:24:09 +0200 Subject: nolo_get_hwrev and nolo_set_hwrev - use int16_t --- src/main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 7322857..87ce93f 100644 --- a/src/main.c +++ b/src/main.c @@ -415,6 +415,7 @@ int main(int argc, char **argv) { struct usb_device_info * usb_dev = NULL; + int tmp; char buf[512]; simulate = 0; @@ -958,9 +959,11 @@ int main(int argc, char **argv) { else printf("Device: %s\n", device_to_string(usb_dev->detected_device)); - buf[0] = 0; - nolo_get_hwrev(usb_dev, buf, sizeof(buf)); - printf("HW revision: %s\n", buf[0] ? buf : "(not detected)"); + tmp = nolo_get_hwrev(usb_dev); + if ( tmp <= 0 ) + printf("HW revision: (not detected)\n"); + else + printf("HW revision: %d\n", tmp); if ( buf[0] ) usb_dev->detected_hwrev = atoi(buf); @@ -1121,7 +1124,7 @@ int main(int argc, char **argv) { if ( set_rd_flags ) nolo_set_rd_flags(usb_dev, set_rd_flags_arg); if ( set_hw ) - nolo_set_hwrev(usb_dev, set_hw_arg); + nolo_set_hwrev(usb_dev, atoi(set_hw_arg)); if ( set_nolo ) nolo_set_nolo_ver(usb_dev, set_nolo_arg); if ( set_kernel ) -- cgit v1.2.3