Fix phantom move when no non-captures
[hachu.git] / hachu.c
diff --git a/hachu.c b/hachu.c
index 711ec43..0c8a239 100644 (file)
--- a/hachu.c
+++ b/hachu.c
@@ -1950,6 +1950,7 @@ if(PATH) printf("# autofail end (%d-%d)\n", firstMove, msp);
          case 6: // non-captures\r
            nonCapts = msp;\r
            nullMove = GenNonCapts(oldPromo);\r
+           if(msp == nonCapts) goto cutoff;\r
 #ifdef KILLERS\r
            { // swap killers to front\r
              Move h = killer[level][0]; int j = curMove;\r
@@ -2318,6 +2319,7 @@ Convert (char *fen)
         *p++ = table[2* (*fen - 'A' - n)+1] + n;\r
       }\r
     } else *p++ = *fen;\r
+    if(!*fen) break;\r
     fen++;\r
   }\r
   printf("# converted FEN '%s'\n", fenArray);\r