Fixed solo mining

It was broken since 6.7.0
This commit is contained in:
SChernykh 2021-01-15 11:18:36 +01:00
parent af019fed8e
commit 5c449913af
2 changed files with 7 additions and 4 deletions

View file

@ -46,7 +46,7 @@ static char *cvt_bin2hex(char *const hex, const size_t hex_maxlen, const unsigne
int b;
int c;
if (bin_len >= SIZE_MAX / 2 || hex_maxlen <= bin_len * 2U) {
if (bin_len >= SIZE_MAX / 2 || hex_maxlen < bin_len * 2U) {
return nullptr; /* LCOV_EXCL_LINE */
}
@ -60,7 +60,10 @@ static char *cvt_bin2hex(char *const hex, const size_t hex_maxlen, const unsigne
hex[i * 2U + 1U] = (char) x;
i++;
}
hex[i * 2U] = 0U;
if (i * 2U < hex_maxlen) {
hex[i * 2U] = 0U;
}
return hex;
}