From aeb44a35ac07f9dc77175e37818d4ee801b62f9f Mon Sep 17 00:00:00 2001 From: Pavel A Date: Sun, 21 Feb 2016 21:46:05 +0200 Subject: [PATCH] Fix for #7 (by kevinchuangtw) Bug: during enumeration keeps only 1st and last device --- lib/usb_relay_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/usb_relay_lib.c b/lib/usb_relay_lib.c index 73ad60c..b029823 100644 --- a/lib/usb_relay_lib.c +++ b/lib/usb_relay_lib.c @@ -69,7 +69,7 @@ struct enumctx_s { // Globals -const char *g_dummyPath = "NOTHING"; // passing dev.path to client not implemented, I return this as path. +static const char *g_dummyPath = "NOTHING"; // passing dev.path to client not implemented, I return this as path. static const char *usbErrorMessage(int errCode) { @@ -280,6 +280,7 @@ int enumfunc(USBDEVHANDLE usbh, void *context) ectx->tail =q; } else { ectx->tail->urdi.next = (pusb_relay_device_info_t)q; + ectx->tail = q; } ++ectx->numdevs; -- 2.25.1