- Bugfix: LibusbJava.cpp, Ln 1288 removed the manipulation of the return value

- Bugfix: Guaranteeing '\0'-Termination of the retrieved C-Strings for all libusb_get_string_descriptor* calls
- Change: The whole interface makes now use of exceptions to pass errors into the java environment instead encoding them into return values.
- Change: Allowing Descriptor strings to have a length of 0

git-svn-id: https://svn.code.sf.net/p/libusbjava/code/trunk@292 94ad28fe-ef68-46b1-9651-e7ae4fcf1c4c
This commit is contained in:
uniederer
2012-04-12 14:40:09 +00:00
parent 0aae67e050
commit 667906d5d4
9 changed files with 826 additions and 303 deletions

View File

@@ -223,9 +223,9 @@ public class Device {
if (dev != null) {
long res = LibusbJava.usb_open(dev);
if (res <= 0) {
if (res == 0) {
throw new USBException("LibusbJava.usb_open: "
+ LibusbJava.usb_strerror() + " (" + res + ")");
+ LibusbJava.usb_strerror());
}
usbDevHandle = res;
}