Merge pull request #570 from AngeGallego/fix-conditional-jump

Valgrind showed conditonal jumps when printing the hashrate
This commit is contained in:
xmrig 2018-04-21 22:19:53 +07:00 committed by GitHub
commit c48e0821c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -151,10 +151,10 @@ void Hashrate::add(size_t threadId, uint64_t count, uint64_t timestamp)
void Hashrate::print() void Hashrate::print()
{ {
char num1[8]; char num1[8] = { 0 };
char num2[8]; char num2[8] = { 0 };
char num3[8]; char num3[8] = { 0 };
char num4[8]; char num4[8] = { 0 };
LOG_INFO(m_controller->config()->isColors() ? "\x1B[01;37mspeed\x1B[0m 2.5s/60s/15m \x1B[01;36m%s \x1B[22;36m%s %s \x1B[01;36mH/s\x1B[0m max: \x1B[01;36m%s H/s" : "speed 2.5s/60s/15m %s %s %s H/s max: %s H/s", LOG_INFO(m_controller->config()->isColors() ? "\x1B[01;37mspeed\x1B[0m 2.5s/60s/15m \x1B[01;36m%s \x1B[22;36m%s %s \x1B[01;36mH/s\x1B[0m max: \x1B[01;36m%s H/s" : "speed 2.5s/60s/15m %s %s %s H/s max: %s H/s",
format(calc(ShortInterval), num1, sizeof(num1)), format(calc(ShortInterval), num1, sizeof(num1)),