Skip to content

Commit e46e05e

Browse files
authored
dg_ctl: fix segfault when using --output option (#2330)
1 parent 26e7c69 commit e46e05e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
8+
### Fixed
9+
10+
- dg_ctl fix segfault when create models is called with --output
11+
712
### Added
813

914
- dg_ctl create models new command line option -o | --output

drogon_ctl/create_model.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,7 @@ void create_model::handleCommand(std::vector<std::string> &parameters)
12141214
break;
12151215
}
12161216
}
1217-
for (auto iter = parameters.begin(); iter != parameters.end(); ++iter)
1217+
for (auto iter = parameters.begin(); iter != parameters.end();)
12181218
{
12191219
auto &file = *iter;
12201220
if (file == "-o" || file == "--output")
@@ -1227,6 +1227,7 @@ void create_model::handleCommand(std::vector<std::string> &parameters)
12271227
}
12281228
continue;
12291229
}
1230+
++iter;
12301231
}
12311232

12321233
for (auto const &path : parameters)

0 commit comments

Comments
 (0)