Browse Source

Merge commit 'a3b12c6' into bfgminer-2.10.x

Luke Dashjr 12 years ago
parent
commit
33a9bfe724
1 changed files with 5 additions and 3 deletions
  1. 5 3
      miner.c

+ 5 - 3
miner.c

@@ -7850,8 +7850,7 @@ int main(int argc, char *argv[])
 #ifndef WIN32
 	signal(SIGPIPE, SIG_IGN);
 #endif
-	opt_kernel_path = alloca(PATH_MAX);
-	strcpy(opt_kernel_path, CGMINER_PREFIX);
+	opt_kernel_path = CGMINER_PREFIX;
 	cgminer_path = alloca(PATH_MAX);
 	s = strdup(argv[0]);
 	strcpy(cgminer_path, dirname(s));
@@ -7963,7 +7962,10 @@ int main(int argc, char *argv[])
 		cnfbuf = NULL;
 	}
 
-	strcat(opt_kernel_path, "/");
+	i = strlen(opt_kernel_path) + 2;
+	char __kernel_path[i];
+	snprintf(__kernel_path, i, "%s/", opt_kernel_path);
+	opt_kernel_path = __kernel_path;
 
 	if (want_per_device_stats)
 		opt_log_output = true;