From 5ccd9d9d9afa88c8e454ab2c05f3a03c0f6a5a16 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik <bubnikv@gmail.com> Date: Thu, 29 Oct 2020 13:16:32 +0100 Subject: [PATCH] Fixed previous commit for Linux/OSX --- src/libslic3r/GCode/GCodeProcessor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index f145fcec6..5722d0ad7 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -977,7 +977,9 @@ template<typename T> { // Legacy conversion, which is costly due to having to make a copy of the string before conversion. try { - std::string str { str }; + assert(sv.size() < 1024); + assert(sv.data() != nullptr); + std::string str { sv }; size_t read = 0; if constexpr (std::is_same_v<T, int>) out = std::stoi(str, &read);