From 49030e3e5bdd412f44a886be6349ebfd2c05bbf2 Mon Sep 17 00:00:00 2001 From: precondition <57645186+precondition@users.noreply.github.com> Date: Wed, 5 Oct 2022 19:42:05 +0200 Subject: [PATCH] Use get_u16_str instead of snprintf in autoshift_timer_report (#18606) --- quantum/process_keycode/process_auto_shift.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c index 3ff188ba7e..644ad2cbaf 100644 --- a/quantum/process_keycode/process_auto_shift.c +++ b/quantum/process_keycode/process_auto_shift.c @@ -17,7 +17,6 @@ #ifdef AUTO_SHIFT_ENABLE # include -# include # include "process_auto_shift.h" # ifndef AUTO_SHIFT_DISABLED_AT_STARTUP @@ -331,11 +330,12 @@ void autoshift_disable(void) { # ifndef AUTO_SHIFT_NO_SETUP void autoshift_timer_report(void) { # ifdef SEND_STRING_ENABLE - char display[8]; - - snprintf(display, 8, "\n%d\n", autoshift_timeout); - - send_string((const char *)display); + const char *autoshift_timeout_str = get_u16_str(autoshift_timeout, ' '); + // Skip padding spaces + while (*autoshift_timeout_str == ' ') { + autoshift_timeout_str++; + } + send_string(autoshift_timeout_str); # endif } # endif