Skip to content

Commit 153404b

Browse files
fix: skip if arg is empty (i'm not sure how you would pass an empty arg but whatever suits your suit)
1 parent 4244dee commit 153404b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,6 +2076,7 @@ ProcInfos findMyProc(const char *procname, HANDLE hSnapshot) {
20762076
std::vector<std::string> normalizeArgs(std::vector<std::string>& args) {
20772077
// this function can seem a little obfuscated so let me help
20782078
for (size_t i = 0; i < args.size(); i++) {
2079+
if (args[i].empty()) continue; // if arg empty then program kaboom but i'm not sure how'd you pass an empty arg
20792080
if (args[i].at(0) == '/') { // if it starts with a /
20802081
args[i].at(0) = '-'; // then set it to - to normalize the argument, so /help turns into -help
20812082
} else if (args[i].at(0) == '-') { // if it starts with a -

0 commit comments

Comments
 (0)