From 8b324e08d9ebe22c5e1328e964e426d9f2b942cb Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 13 Aug 2020 20:27:55 -0500 Subject: [PATCH] Fix sprintf_P call --- Marlin/src/gcode/calibrate/G34_M422.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Marlin/src/gcode/calibrate/G34_M422.cpp b/Marlin/src/gcode/calibrate/G34_M422.cpp index 07e2bee488..eeb18a9ca8 100644 --- a/Marlin/src/gcode/calibrate/G34_M422.cpp +++ b/Marlin/src/gcode/calibrate/G34_M422.cpp @@ -260,11 +260,13 @@ void GcodeSuite::G34() { #endif ); #if HAS_DISPLAY - char msg[30], fstr1[16]; - #if NUM_Z_STEPPER_DRIVERS == 3 - char fstr2[16], fstr3[16]; + char fstr1[10]; + #if NUM_Z_STEPPER_DRIVERS == 2 + char msg[6 + (6 + 5) * 1 + 1]; + #else + char msg[6 + (6 + 5) * 3 + 1], fstr2[10], fstr3[10]; #endif - sprintf_P( + sprintf_P(msg, PSTR("Diffs Z1-Z2=%s" #if NUM_Z_STEPPER_DRIVERS == 3 " Z2-Z3=%s"