🚨Fix buffer overrun warning in UBL (#26984)

to account for null terminator
This commit is contained in:
Chris
2024-04-20 23:43:31 +02:00
committed by GitHub
parent 02ba6f9f3a
commit b4a95db7da

View File

@@ -144,7 +144,7 @@ void _lcd_ubl_custom_mesh() {
* UBL Adjust Mesh Height Command * UBL Adjust Mesh Height Command
*/ */
void _lcd_ubl_adjust_height_cmd() { void _lcd_ubl_adjust_height_cmd() {
char ubl_lcd_gcode[13]; char ubl_lcd_gcode[14];
const int ind = ubl_height_amount > 0 ? 6 : 7; const int ind = ubl_height_amount > 0 ? 6 : 7;
strcpy_P(ubl_lcd_gcode, PSTR("G29P6C-")); strcpy_P(ubl_lcd_gcode, PSTR("G29P6C-"));
sprintf_P(&ubl_lcd_gcode[ind], PSTR(".%i"), ABS(ubl_height_amount)); sprintf_P(&ubl_lcd_gcode[ind], PSTR(".%i"), ABS(ubl_height_amount));