Skip to content

Commit 65bc1cf

Browse files
committed
fix scoping of dst_filename
1 parent c17a2e8 commit 65bc1cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/LibBGCode/cmd/main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,14 @@ bool parse_args(int argc, const char* argv[], std::string& src_filename, bool& s
184184
int main(int argc, const char* argv[])
185185
{
186186
std::string src_filename;
187+
std::string dst_filename;
187188
bool src_is_binary;
188189
bool is_post_processing = false;
189190
BinarizerConfig config;
190191
if (!parse_args(argc, argv, src_filename, src_is_binary, is_post_processing, config))
191192
return EXIT_FAILURE;
192193

194+
193195
// scope for files
194196
{
195197
// Open source file
@@ -206,7 +208,7 @@ int main(int argc, const char* argv[])
206208
const std::string dst_extension = src_is_binary ?
207209
(src_extension == ".gcode") ? ".1.gcode" : ".gcode" :
208210
(src_extension == ".bgcode") ? ".1.bgcode" : ".bgcode";
209-
const std::string dst_filename = src_stem + dst_extension;
211+
dst_filename = src_stem + dst_extension;
210212

211213
// Open destination file
212214
FILE* dst_file = boost::nowide::fopen(dst_filename.c_str(), "wb");

0 commit comments

Comments
 (0)