Commit 1b3401e3a8813981d99fbee8cd3b9913b509f92d

Con Kolivas 2014-04-22T20:32:16

Set the unique id only for usb devices with serial strings longer than 4 chars long

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/cgminer.c b/cgminer.c
index fff7482..c315dbe 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -8929,7 +8929,8 @@ bool add_cgpu(struct cgpu_info *cgpu)
 
 	adjust_mostdevs();
 #ifdef USE_USBUTILS
-	if (cgpu->usbdev && !cgpu->unique_id && cgpu->usbdev->serial_string)
+	if (cgpu->usbdev && !cgpu->unique_id && cgpu->usbdev->serial_string &&
+	    strlen(cgpu->usbdev->serial_string) > 4)
 		cgpu->unique_id = str_text(cgpu->usbdev->serial_string);
 #endif
 	return true;