From 802579ad209f9b2a64f43dc8aa0e96d0a21672ad Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Mon, 5 Mar 2018 10:53:18 +0100 Subject: [PATCH] Fixed crash while exporting to .amf and .gcode files (#753) - (improves previous fix: https://github.com/prusa3d/Slic3r/commit/d4f1ed0036183153464df7b5eef66cf60c7c6433) --- xs/src/libslic3r/GCode.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/xs/src/libslic3r/GCode.cpp b/xs/src/libslic3r/GCode.cpp index 28c03ba2c..8ad479532 100644 --- a/xs/src/libslic3r/GCode.cpp +++ b/xs/src/libslic3r/GCode.cpp @@ -1402,18 +1402,13 @@ void GCode::apply_print_config(const PrintConfig &print_config) void GCode::append_full_config(const Print& print, std::string& str) { - char buff[4096]; - const StaticPrintConfig *configs[] = { &print.config, &print.default_object_config, &print.default_region_config }; for (size_t i = 0; i < sizeof(configs) / sizeof(configs[0]); ++i) { const StaticPrintConfig *cfg = configs[i]; for (const std::string &key : cfg->keys()) { if (key != "compatible_printers") - { - sprintf(buff, "; %s = %s\n", key.c_str(), cfg->serialize(key).c_str()); - str += buff; - } + str += "; " + key + " = " + cfg->serialize(key) + "\n"; } } }