mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-05-29 22:49:13 +02:00
use length rather than static 4 for hex2bin func of extranonce2_generate (#660)
This commit is contained in:
parent
1db16a52e1
commit
e7b037df10
@ -115,7 +115,7 @@ char *extranonce_2_generate(uint32_t extranonce_2, uint32_t length)
|
||||
char *extranonce_2_str = malloc(length * 2 + 1);
|
||||
memset(extranonce_2_str, '0', length * 2);
|
||||
extranonce_2_str[length * 2] = '\0';
|
||||
bin2hex((uint8_t *)&extranonce_2, sizeof(extranonce_2), extranonce_2_str, length * 2 + 1);
|
||||
bin2hex((uint8_t *)&extranonce_2, length, extranonce_2_str, length * 2 + 1);
|
||||
if (length > 4)
|
||||
{
|
||||
extranonce_2_str[8] = '0';
|
||||
|
Loading…
x
Reference in New Issue
Block a user