Skip to content

Commit 6008f5f

Browse files
fix: make it so it doesn't crash if an arg doesn't have 2 characters
1 parent 153404b commit 6008f5f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2080,7 +2080,7 @@ std::vector<std::string> normalizeArgs(std::vector<std::string>& args) {
20802080
if (args[i].at(0) == '/') { // if it starts with a /
20812081
args[i].at(0) = '-'; // then set it to - to normalize the argument, so /help turns into -help
20822082
} else if (args[i].at(0) == '-') { // if it starts with a -
2083-
if (args[i].at(1) == '-') { // then check if the person put another - like --help
2083+
if (args[i].size() > 1 && args[i].at(1) == '-') { // then check if the person put another - like --help
20842084
args[i].erase(0, 1); // if so then delete first char and it turns into -help
20852085
} else {
20862086
// do nothing

0 commit comments

Comments
 (0)