Browse Source

api: fix size_t printf exception in vstudio

master
Tanguy Pruvot 10 years ago
parent
commit
9a97f0cf6e
  1. 4
      api.cpp
  2. 2
      ccminer.cpp

4
api.cpp

@ -232,10 +232,10 @@ static char *getpoolnfo(char *params)
cbin2hex(nonce, (const char*) stratum.job.xnonce2, stratum.xnonce2_size); cbin2hex(nonce, (const char*) stratum.job.xnonce2, stratum.xnonce2_size);
} }
sprintf(p, "URL=%s;USER=%s;H=%u;JOB=%s;DIFF=%.6f;N2SZ=%zd;N2=0x%s;PING=%u;DISCO=%u;UPTIME=%u|", snprintf(p, MYBUFSIZ, "URL=%s;USER=%s;H=%u;JOB=%s;DIFF=%.6f;N2SZ=%d;N2=0x%s;PING=%u;DISCO=%u;UPTIME=%u|",
stratum.url, rpc_user ? rpc_user : "", stratum.url, rpc_user ? rpc_user : "",
stratum.job.height, jobid, stratum.job.diff, stratum.job.height, jobid, stratum.job.diff,
stratum.xnonce2_size, nonce, stratum.answer_msec, (int) stratum.xnonce2_size, nonce, stratum.answer_msec,
stratum.disconnects, (uint32_t) (time(NULL) - stratum.tm_connected)); stratum.disconnects, (uint32_t) (time(NULL) - stratum.tm_connected));
return p; return p;

2
ccminer.cpp

@ -1528,7 +1528,7 @@ static bool stratum_handle_response(char *buf)
gettimeofday(&tv_answer, NULL); gettimeofday(&tv_answer, NULL);
timeval_subtract(&diff, &tv_answer, &stratum.tv_submit); timeval_subtract(&diff, &tv_answer, &stratum.tv_submit);
// store time required to the pool to answer to a submit // store time required to the pool to answer to a submit
stratum.answer_msec = (1000.0 * diff.tv_sec) + (uint32_t) (0.001 * diff.tv_usec); stratum.answer_msec = (1000 * diff.tv_sec) + (uint32_t) (0.001 * diff.tv_usec);
share_result(json_is_true(res_val), share_result(json_is_true(res_val),
err_val ? json_string_value(json_array_get(err_val, 1)) : NULL); err_val ? json_string_value(json_array_get(err_val, 1)) : NULL);

Loading…
Cancel
Save