aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <adammegarules1@gmail.com>2026-08-02 13:32:03 +0200
committerAdam <adammegarules1@gmail.com>2026-08-02 13:32:03 +0200
commitcc9fad0820d620c8a8fb609a257b82bc36b37c5d (patch)
tree3b198eb54caa6b50986eefac622a1cbbafdcbd49 /src
parent9d2a95f566c5cb31d92af969d052b665ccbea9be (diff)
error hangling
Diffstat (limited to 'src')
-rw-r--r--src/uci.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/uci.cpp b/src/uci.cpp
index 4357e99..f099b78 100644
--- a/src/uci.cpp
+++ b/src/uci.cpp
@@ -11,6 +11,7 @@
#include <cctype>
#include <cstdint>
#include <cstdio>
+#include <cstdlib>
#include <iostream>
#include <sstream>
#include <string>
@@ -129,7 +130,10 @@ void Uci() {
break;
}
}
-
+ if (depth != -1 && depth <= 0) {
+ cout << "Fatal: Depth must be positive integer";
+ exit(1);
+ }
Move best = GetBestMove(&game, depth);
cout << "bestmove ";