From cfb65267322a6d66ceaf40e640bd6d8691aa6863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0ach?= Date: Thu, 9 Nov 2023 10:52:38 +0100 Subject: [PATCH] Bugfix: Uninitialized value in wipe tower integration. Just a small fix to avoid c++ undefined behaviour. --- src/libslic3r/GCode/WipeTowerIntegration.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode/WipeTowerIntegration.cpp b/src/libslic3r/GCode/WipeTowerIntegration.cpp index 5beca23ba2..ef0797be0d 100644 --- a/src/libslic3r/GCode/WipeTowerIntegration.cpp +++ b/src/libslic3r/GCode/WipeTowerIntegration.cpp @@ -157,8 +157,11 @@ std::string WipeTowerIntegration::post_process_wipe_tower_moves(const WipeTower: while (line_str >> ch) { if (ch == 'X' || ch == 'Y') line_str >> (ch == 'X' ? pos.x() : pos.y()); - else if (ch == 'Z') - line_str >> *z; + else if (ch == 'Z') { + float z_value; + line_str >> z_value; + z = z_value; + } else line_out << ch; }