Skip to content

Commit

Permalink
bug when processing multiple fixed modules
Browse files Browse the repository at this point in the history
  • Loading branch information
btzy committed Jan 4, 2018
1 parent fb5c8a0 commit 704f99e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ x64/
Autotimetable/Debug/
Autotimetable/Release/
Autotimetable/x64/
Autotimetable/*.exe
Autotimetable/*.exe
.vs/
2 changes: 1 addition & 1 deletion Autotimetable/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ inline std::tuple<std::string, std::string, std::string> parse_fixed_mod(const s
throw std::invalid_argument("Cannot parse fixed mod selection: \"" + fixed_mods_str.substr(begin, end - begin) + "\".");
}
std::size_t c3 = fixed_mods_str.find(':', c2 + 1);
if (c3 != std::string::npos) {
if (c3 < end) {
throw std::invalid_argument("Cannot parse fixed mod selection: \"" + fixed_mods_str.substr(begin, end - begin) + "\".");
}
return std::tuple<std::string, std::string, std::string>(fixed_mods_str.substr(begin, c1 - begin), fixed_mods_str.substr(c1 + 1, c2 - (c1 + 1)), fixed_mods_str.substr(c2 + 1, end - (c2 + 1)));
Expand Down
2 changes: 1 addition & 1 deletion Autotimetable/modules.json

Large diffs are not rendered by default.

0 comments on commit 704f99e

Please sign in to comment.