Skip to content

Commit

Permalink
fix gcc problem
Browse files Browse the repository at this point in the history
  • Loading branch information
KlausT committed Aug 17, 2017
1 parent 600ecb4 commit b4cde6c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1194,8 +1194,10 @@ static bool stratum_parse_extranonce(struct stratum_ctx *sctx, const json_t *par
bool stratum_subscribe(struct stratum_ctx *sctx)
{
json_error_t err;
json_t *val;
json_t *res_val;
bool ret = false, retry = false;

char *sret;
start:
char *s = (char*)malloc(128 + (sctx->session_id ? strlen(sctx->session_id) : 0));
if(s == NULL)
Expand All @@ -1219,11 +1221,11 @@ bool stratum_subscribe(struct stratum_ctx *sctx)
goto out;
}

char *sret = stratum_recv_line(sctx);
sret = stratum_recv_line(sctx);
if(!sret)
goto out;

json_t *val = JSON_LOADS(sret, &err);
val = JSON_LOADS(sret, &err);
free(sret);
if(!val)
{
Expand All @@ -1236,7 +1238,7 @@ bool stratum_subscribe(struct stratum_ctx *sctx)
applog(LOG_WARNING, "Stratum subscribe answer id is not correct!");
}

const json_t *res_val = json_object_get(val, "result");
res_val = json_object_get(val, "result");
const json_t *err_val = json_object_get(val, "error");

if(!res_val || json_is_null(res_val) || (err_val && !json_is_null(err_val)))
Expand Down

0 comments on commit b4cde6c

Please sign in to comment.