From b5ece63778cb3f1b5eb8f173643a9de621764820 Mon Sep 17 00:00:00 2001 From: Victor Tseng Date: Tue, 28 Jul 2020 09:13:27 +0800 Subject: [PATCH] Fix garbled print_xyz output (#18810) --- Marlin/src/core/serial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/core/serial.cpp b/Marlin/src/core/serial.cpp index 77854d0f8..0d22f7bfc 100644 --- a/Marlin/src/core/serial.cpp +++ b/Marlin/src/core/serial.cpp @@ -68,7 +68,7 @@ void print_bin(uint16_t val) { extern const char SP_X_STR[], SP_Y_STR[], SP_Z_STR[]; void print_xyz(const float &x, const float &y, const float &z, PGM_P const prefix/*=nullptr*/, PGM_P const suffix/*=nullptr*/) { - serialprintPGM(prefix); + if (prefix) serialprintPGM(prefix); SERIAL_ECHOPAIR_P(SP_X_STR, x, SP_Y_STR, y, SP_Z_STR, z); if (suffix) serialprintPGM(suffix); else SERIAL_EOL(); }