From 74346efccb6c1195476ac9dc7c76b353550ccb4b Mon Sep 17 00:00:00 2001 From: bubnikv Date: Mon, 15 May 2017 16:42:29 +0200 Subject: [PATCH] Fix of a multi-material g-code export. --- xs/src/libslic3r/GCode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xs/src/libslic3r/GCode.cpp b/xs/src/libslic3r/GCode.cpp index cdcb06d6f..ce0be2ec8 100644 --- a/xs/src/libslic3r/GCode.cpp +++ b/xs/src/libslic3r/GCode.cpp @@ -645,7 +645,7 @@ void GCode::process_layer( for (size_t i = 1; i < extruder_ids.size(); ++ i) if (extruder_ids[i] == m_writer.extruder()->id) { // Move the last extruder to the front. - memmove(extruder_ids.data() + 1, extruder_ids.data(), i); + memmove(extruder_ids.data() + 1, extruder_ids.data(), i * sizeof(unsigned int)); extruder_ids.front() = m_writer.extruder()->id; break; } @@ -808,7 +808,7 @@ void GCode::process_layer( for (size_t i = 1; i < extruders.size(); ++ i) if (extruders[i] == m_writer.extruder()->id) { // Move the last extruder to the front. - memmove(extruders.data() + 1, extruders.data(), i); + memmove(extruders.data() + 1, extruders.data(), i * sizeof(unsigned int)); extruders.front() = m_writer.extruder()->id; break; }