projects
/
pub
/
pl2303-ft232-gpio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
47ac4ef
)
Do not segfault when no device is present
author
Andrew 'Necromant' Andrianov
<andrew@ncrmnt.org>
Sun, 21 Dec 2014 11:26:57 +0000
(14:26 +0300)
committer
Andrew 'Necromant' Andrianov
<andrew@ncrmnt.org>
Sun, 21 Dec 2014 11:26:57 +0000
(14:26 +0300)
Fixes #1
Signed-off-by: Andrew 'Necromant' Andrianov <andrew@ncrmnt.org>
main.c
patch
|
blob
|
blame
|
history
diff --git
a/main.c
b/main.c
index
f6b1643
..
f24e40f
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-159,8
+159,8
@@
void check_handle(usb_dev_handle **h)
/* TODO: Make a proper way to select different PL2303 devices. */
*h = nc_usb_open(I_VENDOR_NUM, I_PRODUCT_NUM, NULL, NULL, NULL);
- if (!
h
) {
- fprintf(stderr, "No PL2303 USB device
found ;(\n"
);
+ if (!
(*h)
) {
+ fprintf(stderr, "No PL2303 USB device
%04x:%04x found ;(\n", I_VENDOR_NUM, I_PRODUCT_NUM
);
exit(1);
}
@@
-231,9
+231,5
@@
int main(int argc, char* argv[])
}
}
-
return 0;
-
- //GP0 == LDR
- //GP1 == RST
}