Commit 8f954d40ec09795aadf5588fcfe83f5768cb292a

ckolivas 2012-07-01T10:17:12

Get rid of unused result warning with asprintf.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/util.c b/util.c
index ffc6a70..a617f21 100644
--- a/util.c
+++ b/util.c
@@ -326,8 +326,7 @@ json_t *json_rpc_call(CURL *curl, const char *url,
 	headers = curl_slist_append(headers,
 		"X-Mining-Extensions: longpoll midstate rollntime submitold");
 
-	if (likely(global_hashrate)) {
-		asprintf(&ghashrate, "X-Mining-Hashrate: %llu", global_hashrate);
+	if (likely(global_hashrate && asprintf(&ghashrate, "X-Mining-Hashrate: %llu", global_hashrate) != -1)) {
 		headers = curl_slist_append(headers, ghashrate);
 		free(ghashrate);
 	}