version 1.4.60b
[polyglot.git] / uci.c
diff --git a/uci.c b/uci.c
index 65d4d2a..05d60b3 100644 (file)
--- a/uci.c
+++ b/uci.c
@@ -153,7 +153,7 @@ void uci_open(uci_t * uci, engine_t * engine) {
       // Handle the case that the engine is really a WB engine somewhat gracefully.\r
       if((strstr(string,"Illegal") || strstr(string,"Error"))\r
          &&strstr(string,"uci")){\r
-          my_fatal("uci_open(): Not an UCI engine.\n");\r
+          my_fatal("uci_open(): Not a UCI engine.\n");\r
       }\r
       event = uci_parse(uci,string);\r
    } while (!engine_eof(Engine) && (event & EVENT_UCI) == 0);\r
@@ -435,10 +435,14 @@ static int parse_bestmove(uci_t * uci, const char string[]) {
 \r
    // bestmove\r
 \r
+   uci->bestmove[0]='\0';\r
    if (!parse_get_string(parse,argument,StringSize)) {\r
+       strcpy(uci->bestmove,"nomove");\r
        return EVENT_ILLEGAL_MOVE;\r
 //      my_fatal("parse_bestmove(): missing argument\n");\r
    }\r
+   strncpy(uci->bestmove,argument,UciStringSize);\r
+   uci->bestmove[UciStringSize-1]='\0';\r
 \r
    uci->best_move = move_from_can(argument,uci->board);\r
    if (uci->best_move == MoveNone) {\r