🐛 Fix expand_u8str_P string substitution

Fixes #26424
This commit is contained in:
Scott Lahteine 2023-11-22 22:18:41 -06:00
parent bf61e52390
commit ded942a4e4
2 changed files with 2 additions and 2 deletions

View file

@ -352,7 +352,7 @@ namespace LanguageNarrow_en {
LSTR MSG_LCD_ON = _UxGT("On"); LSTR MSG_LCD_ON = _UxGT("On");
LSTR MSG_LCD_OFF = _UxGT("Off"); LSTR MSG_LCD_OFF = _UxGT("Off");
LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune"); LSTR MSG_PID_AUTOTUNE = _UxGT("PID Autotune");
LSTR MSG_PID_AUTOTUNE_E = _UxGT("PID Autotune *"); LSTR MSG_PID_AUTOTUNE_E = _UxGT("Autotune * PID");
LSTR MSG_PID_CYCLE = _UxGT("PID Cycles"); LSTR MSG_PID_CYCLE = _UxGT("PID Cycles");
LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done"); LSTR MSG_PID_AUTOTUNE_DONE = _UxGT("PID tuning done");
LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Autotune failed!"); LSTR MSG_PID_AUTOTUNE_FAILED = _UxGT("Autotune failed!");

View file

@ -68,7 +68,7 @@ lcd_uint_t expand_u8str_P(char * const outstr, PGM_P const ptpl, const int8_t in
else { else {
PGM_P const b = ind == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED); PGM_P const b = ind == -2 ? GET_TEXT(MSG_CHAMBER) : GET_TEXT(MSG_BED);
strncpy_P(o, b, n); strncpy_P(o, b, n);
n -= utf8_strlen_P(b); n -= utf8_strlen(o);
o += strlen(o); o += strlen(o);
} }
if (n > 0) { if (n > 0) {