From 8b9f3951b1e725b6d35d0e5fc45225b6484f7f02 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 27 Aug 2026 13:42:14 +0200 Subject: [PATCH] fix overeager padding being added to string array --- client/src/util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/util.c b/client/src/util.c index f6a556fd3..8151dcfe9 100644 --- a/client/src/util.c +++ b/client/src/util.c @@ -272,7 +272,10 @@ void hex_to_buffer(uint8_t *buf, const uint8_t *hex_data, const size_t hex_len, m = hex_max_len; } - while (m--) { + // Pad up to m, the way ascii_to_buffer() above does. This used to write m + // spaces from wherever it had got to, so a padded field came out i + // characters too wide - a 7 byte AID asked to fill 16 produced 30. + for (; i < m; i++) { *(tmp++) = ' '; }