Browse Source

Merge commit '77e7990' into bfgminer

Luke Dashjr 12 years ago
parent
commit
08a7a76403
1 changed files with 5 additions and 0 deletions
  1. 5 0
      api-example.c

+ 5 - 0
api-example.c

@@ -200,6 +200,11 @@ int callapi(char *command, char *host, short int port)
 	SOCKETINIT;
 
 	ip = gethostbyname(host);
+	if (!ip)
+	{
+		printf("Failed to resolve host %s\n", host);
+		return 1;
+	}
 
 	sock = socket(AF_INET, SOCK_STREAM, 0);
 	if (sock == INVSOCK) {