Browse Source

Merge commit '74e4cee' into bfgminer-3.2.x

Luke Dashjr 12 years ago
parent
commit
2b884189f9
1 changed files with 3 additions and 3 deletions
  1. 3 3
      miner.c

+ 3 - 3
miner.c

@@ -986,13 +986,13 @@ static char *set_url(char *arg)
 	opt_set_charp(arg, &pool->rpc_url);
 	opt_set_charp(arg, &pool->rpc_url);
 	if (strncmp(arg, "http://", 7) &&
 	if (strncmp(arg, "http://", 7) &&
 	    strncmp(arg, "https://", 8)) {
 	    strncmp(arg, "https://", 8)) {
+		const size_t L = strlen(arg);
 		char *httpinput;
 		char *httpinput;
 
 
-		httpinput = malloc(255);
+		httpinput = malloc(8 + L);
 		if (!httpinput)
 		if (!httpinput)
 			quit(1, "Failed to malloc httpinput");
 			quit(1, "Failed to malloc httpinput");
-		strcpy(httpinput, "http://");
-		strncat(httpinput, arg, 248);
+		sprintf(httpinput, "http://%s", arg);
 		pool->rpc_url = httpinput;
 		pool->rpc_url = httpinput;
 	}
 	}