diff --git a/kernel/src/utils/string.c b/kernel/src/utils/string.c index 384453f..9a28855 100644 --- a/kernel/src/utils/string.c +++ b/kernel/src/utils/string.c @@ -112,7 +112,8 @@ void string_hex_64bit_to_alpha(string_t string, uint64_t value) { void string_bin_to_alpha(string_t string, uint8_t num_bits, uint64_t value) { char* buffer = (char*)string; - num_bits = MIN(num_bits, 64); + num_bits = MIN(num_bits, 64); + value <<= 64 - num_bits; for (uint8_t i = 0; i < num_bits; i++) { buffer[i] = ((value & (0x8000000000000000 >> i)) > 0) ? '1' : '0'; }