Fix for issue #4021 - Crash due to backslash at end of text fields for Custom G-code (#4117)

* back-slash at end of line in printer settings.../custom g-code does not crash slic3r anymore (issue #4021)

* fixes issue #4021
This commit is contained in:
tmotl 2017-09-04 21:01:28 +02:00 committed by Joseph Lenox
parent c3e6f398db
commit 84275d08d2

View File

@ -32,6 +32,9 @@ std::string escape_string_cstyle(const std::string &str)
if (c == '\n' || c == '\r') { if (c == '\n' || c == '\r') {
(*outptr ++) = '\\'; (*outptr ++) = '\\';
(*outptr ++) = 'n'; (*outptr ++) = 'n';
} else if (c == '\\'){
(*outptr ++) = '\\';
(*outptr ++) = '\\';
} else } else
(*outptr ++) = c; (*outptr ++) = c;
} }