Fix "possible buffer overrun" warning (#17513)

This commit is contained in:
Jason Smith 2020-04-20 05:16:38 -07:00 committed by GitHub
parent 90a432279b
commit cba58b1027
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23

View file

@ -188,8 +188,8 @@ void _lcd_ubl_edit_mesh() {
*/
void _lcd_ubl_validate_custom_mesh() {
char ubl_lcd_gcode[24];
const int temp = TERN(HAS_HEATED_BED, custom_bed_temp, 0);
sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26 C B%i H%i P"), temp, custom_hotend_temp);
const int16_t temp = TERN(HAS_HEATED_BED, custom_bed_temp, 0);
sprintf_P(ubl_lcd_gcode, PSTR("G28\nG26 C B%" PRIi16 " H%" PRIi16 " P"), temp, custom_hotend_temp);
queue.inject(ubl_lcd_gcode);
}