Browse Source

Bugfix: bitmain: Clear opt_bitmain_dev string properly

Luke Dashjr 10 years ago
parent
commit
d43452b8fc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      driver-bitmain.c

+ 1 - 1
driver-bitmain.c

@@ -2206,7 +2206,7 @@ static void bitmain_shutdown(struct thr_info *thr)
 char *set_bitmain_dev(char *arg)
 char *set_bitmain_dev(char *arg)
 {
 {
 	if(arg == NULL || strlen(arg) <= 0) {
 	if(arg == NULL || strlen(arg) <= 0) {
-		memcpy(opt_bitmain_dev, 0, 256);
+		opt_bitmain_dev[0] = '\0';
 	} else {
 	} else {
 		strncpy(opt_bitmain_dev, arg, 256);
 		strncpy(opt_bitmain_dev, arg, 256);
 	}
 	}