Browse Source

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

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

+ 3 - 3
miner.c

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