From 39f71ddef699cc97970ef1e5a9d79e944de45dc9 Mon Sep 17 00:00:00 2001 From: Stefan Kerkmann Date: Thu, 7 Jul 2022 14:14:09 +0200 Subject: [PATCH] [Fix] Patches after printf library update (#17584) * Add missing '(' to print_bin_reverse32 declaration * Fix insufficient character buffers on satisfaction75 * Remove \0 character in format string and use corrected offset math instead on rocketboard 16 * Replace snprintf_ with snprintf for djinn * Explicitly ignore format checks for tracktyl manuform that uses %b specifier * Print properly escaped version string in command.c, as PRODUCT or other defines can contain constructs like 'Vendor keyboard 66%' which will be interpreted as a format specifier --- keyboards/rocketboard_16/keymaps/via/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/rocketboard_16/keymaps/via/keymap.c b/keyboards/rocketboard_16/keymaps/via/keymap.c index ce26a834..08b8e65b 100644 --- a/keyboards/rocketboard_16/keymaps/via/keymap.c +++ b/keyboards/rocketboard_16/keymaps/via/keymap.c @@ -107,10 +107,10 @@ static void oled_write_ln_centered(const char * data, bool inverted) char line_buf[21]; // Amount to offset string from left side - uint8_t offset = (21 - strlen(data))/2; + uint8_t offset = (22 - strlen(data))/2; // Formatted string centering... look, it works, don't ask how... - snprintf(line_buf, 21, "%*s%s%*s\0", offset, "", data, offset, ""); // Centers data within 21 character buffer with null termination + snprintf(line_buf, 21, "%*s%s%*s", offset, "", data, offset, ""); // Centers data within 21 character buffer oled_write_ln(line_buf, inverted); }