From 538b687854e85bfeeaf9c75748d5cd8c5b14421c Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Sun, 11 Dec 2022 09:47:24 +0100 Subject: [PATCH] Fix --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 766ba97..3476398 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -64,7 +64,7 @@ void parseArgument(const string& arg, int &dayNum, bool &useTestInput, int &test } dayNum = stoi(arg.substr(0, tIndex)); useTestInput = true; - testFetchIndex = stoi(arg.substr(tIndex + 1)); + testFetchIndex = tIndex + 1 < arg.size() ? stoi(arg.substr(tIndex + 1)) : 0; } int main(int argc, char *argv[]) {