From 049e73d45e6b635f06eec379cd51a1b873d2c6d8 Mon Sep 17 00:00:00 2001 From: Doridian Date: Tue, 14 Jun 2022 23:54:43 -0700 Subject: [PATCH] This actually is bytes --- client/src/util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/util.c b/client/src/util.c index bf506d3d6..12e0140a7 100644 --- a/client/src/util.c +++ b/client/src/util.c @@ -187,11 +187,10 @@ void hex_to_buffer(uint8_t *buf, const uint8_t *hex_data, const size_t hex_len, char *tmp = tmp_base; size_t max_len = (hex_len > hex_max_len) ? hex_max_len : hex_len; - size_t str_max_len = hex_max_len * (2 + spaces_between); size_t i; for (i = 0; i < max_len; ++i, tmp += 2 + spaces_between) { - snprintf(tmp, str_max_len - (tmp - tmp_base), (uppercase) ? "%02X" : "%02x", (unsigned int) hex_data[i]); + snprintf(tmp, hex_max_len - (tmp - tmp_base), (uppercase) ? "%02X" : "%02x", (unsigned int) hex_data[i]); for (size_t j = 0; j < spaces_between; j++) *(tmp + 2 + j) = ' ';