mirror of
https://github.com/GOSTSec/ccminer
synced 2025-01-10 14:57:53 +00:00
api: fix size_t printf exception in vstudio
This commit is contained in:
parent
7e15f31706
commit
9a97f0cf6e
4
api.cpp
4
api.cpp
@ -232,10 +232,10 @@ static char *getpoolnfo(char *params)
|
||||
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.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));
|
||||
|
||||
return p;
|
||||
|
@ -1528,7 +1528,7 @@ static bool stratum_handle_response(char *buf)
|
||||
gettimeofday(&tv_answer, NULL);
|
||||
timeval_subtract(&diff, &tv_answer, &stratum.tv_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),
|
||||
err_val ? json_string_value(json_array_get(err_val, 1)) : NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user