Browse Source

Bugfix: nanofury: Use maybe_strdup in case strings may be missing

Luke Dashjr 12 years ago
parent
commit
ad4dc1ccee
1 changed files with 4 additions and 3 deletions
  1. 4 3
      driver-nanofury.c

+ 4 - 3
driver-nanofury.c

@@ -20,6 +20,7 @@
 #include "lowlevel.h"
 #include "mcp2210.h"
 #include "miner.h"
+#include "util.h"
 
 #define NANOFURY_USB_PRODUCT "NanoFury"
 
@@ -201,9 +202,9 @@ bool nanofury_foundlowl(struct lowlevel_device_info * const info)
 		.threads = 1,
 		// TODO: .name
 		.device_path = strdup(info->path),
-		.dev_manufacturer = strdup(info->manufacturer),
-		.dev_product = strdup(product),
-		.dev_serial = strdup(serial),
+		.dev_manufacturer = maybe_strdup(info->manufacturer),
+		.dev_product = maybe_strdup(product),
+		.dev_serial = maybe_strdup(serial),
 		.deven = DEV_ENABLED,
 		// TODO: .cutofftemp
 	};