1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

Cope with trailing slashes in stratum urls.

This commit is contained in:
Con Kolivas 2013-09-07 09:14:12 +10:00
parent 41badea76b
commit ddbd3ab78e

9
util.c
View File

@ -1107,9 +1107,14 @@ bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port)
sprintf(url_address, "%.*s", url_len, url_begin);
if (port_len)
if (port_len) {
char *slash;
snprintf(port, 6, "%.*s", port_len, port_start);
else
slash = strchr(port, '/');
if (slash)
*slash = '\0';
} else
strcpy(port, "80");
*sockaddr_port = strdup(port);