diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-05-17 10:42:47 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2013-05-17 10:42:47 +0200 |
commit | f3fcf8402609d946d16eb2d9686bf76d7b0b8ae0 (patch) | |
tree | 71411d124230ccb47bc5f7adfe4400577246c781 | |
parent | 4d7789be7e317fb2e89557f959c1a1a69cc01b26 (diff) | |
download | libusb-f3fcf8402609d946d16eb2d9686bf76d7b0b8ae0.tar.gz |
Examples: Fix use of deprecated libusb_get_port_path
While at it also simplify the path printing in listdevs
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | examples/listdevs.c | 14 | ||||
-rw-r--r-- | examples/xusb.c | 2 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/examples/listdevs.c b/examples/listdevs.c index 05b3998..31ad26e 100644 --- a/examples/listdevs.c +++ b/examples/listdevs.c @@ -39,15 +39,11 @@ static void print_devs(libusb_device **devs) desc.idVendor, desc.idProduct, libusb_get_bus_number(dev), libusb_get_device_address(dev)); - r = libusb_get_port_path(NULL, dev, path, sizeof(path)); - if (r > 0) - printf(" path: "); - j = 0; - while(j < r) { - printf("%d", path[j]); - j++; - if (j < r) - printf("."); + r = libusb_get_port_numbers(dev, path, sizeof(path)); + if (r > 0) { + printf(" path: %d", path[0]); + for (j = 1; j < r; j++) + printf(".%d", path[j]); } printf("\n"); } diff --git a/examples/xusb.c b/examples/xusb.c index 856f723..5bb92a6 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -755,7 +755,7 @@ static int test_device(uint16_t vid, uint16_t pid) dev = libusb_get_device(handle); bus = libusb_get_bus_number(dev); if (extra_info) { - r = libusb_get_port_path(NULL, dev, port_path, sizeof(port_path)); + r = libusb_get_port_numbers(dev, port_path, sizeof(port_path)); if (r > 0) { printf("\nDevice properties:\n"); printf(" bus number: %d\n", bus); diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 9cd9c4a..7eaedda 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10697 +#define LIBUSB_NANO 10698 |