Fix for #7 (by kevinchuangtw)
[usb-relay-hid.git] / lib / usb_relay_lib.c
index 73ad60cb72fb1ad5b4513dbb41fec72361444eca..b0298237088bec82c1f357b6762b78e8b9745a00 100644 (file)
@@ -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;