From 8f954d40ec09795aadf5588fcfe83f5768cb292a Mon Sep 17 00:00:00 2001 From: ckolivas Date: Sun, 1 Jul 2012 10:17:12 +1000 Subject: [PATCH] Get rid of unused result warning with asprintf. --- util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util.c b/util.c index ffc6a70a..a617f219 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); }