shithub: moonfish

Download patch

ref: a13704d6a9820c9ba729c9d73449bc552534e400
parent: 041ed9c6c6e31075450eec8955fe820e8a115500
author: zamfofex <zamfofex@twdb.moe>
date: Fri Jun 21 23:05:43 EDT 2024

fix small bug handling UCI

--- a/main.c
+++ b/main.c
@@ -178,6 +178,11 @@
 			else if (!strcmp(arg, "fen"))
 			{
 				arg = strtok(NULL, "\r\n");
+				if (arg == NULL)
+				{
+					fprintf(stderr, "incomplete 'position fen' command\n");
+					return 1;
+				}
 				moonfish_from_fen(&chess, arg);
 				
 				arg = strstr(arg, "moves");
--