X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=blobdiff_plain;f=UCI2WB.c;h=632df6e4dcea01e394fb80b401188c51ae881190;hp=29d4040d253ca82a83282e7320b75ea60cd9a201;hb=573f12ddca1f3e3eb7b9e6483210a3a8d752c03b;hpb=d22aa698a5c509b3b995f26cfb72249af3129a9b diff --git a/UCI2WB.c b/UCI2WB.c index 29d4040..632df6e 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -39,7 +39,7 @@ #define NONE 2 #define ANALYZE 3 -char move[2000][10], checkOptions[8192], iniPos[256], hashOpt[20], pause, pondering, suspended, ponder, post, hasHash, c, sc='c', *suffix, *variants; +char move[2000][10], checkOptions[8192], iniPos[256], hashOpt[20], pause, pondering, suspended, ponder, post, hasHash, c, sc='c', suffix[81], *variants; int mps, tc, inc, sTime, depth, myTime, hisTime, stm, computer = NONE, memory, oldMem=0, cores, moveNr, lastDepth, lastScore, startTime, debug; int statDepth, statScore, statNodes, statTime, currNr, size, collect, nr, sm, inex, on[500], frc; char currMove[20], moveMap[500][10], /* for analyze mode */ canPonder[20], threadOpt[20]; @@ -147,9 +147,9 @@ StartSearch(char *ponder) DPRINT( "\n# go%s %stime %d %stime %d", ponder, bTime, black ? myTime : hisTime, wTime, !black ? myTime : hisTime); if(sTime > 0) { fprintf(toE, " movetime %d", sTime); DPRINT(" movetime %d", sTime); } else if(mps) { fprintf(toE, " movestogo %d", mps*(nr/(2*mps)+1)-nr/2); DPRINT(" movestogo %d", mps*(nr/(2*mps)+1)-nr/2); } - if(inc && !suffix) { fprintf(toE, " %s %d %s %d", wInc, inc, bInc, inc); DPRINT(" %s %d %s %d", wInc, inc, bInc, inc); } + if(inc && !*suffix) { fprintf(toE, " %s %d %s %d", wInc, inc, bInc, inc); DPRINT(" %s %d %s %d", wInc, inc, bInc, inc); } if(depth > 0) { fprintf(toE, " depth %d", depth); DPRINT(" depth %d", depth); } - if(suffix) { fprintf(toE, suffix, inc); DPRINT(suffix, inc); } + if(*suffix) { fprintf(toE, suffix, inc); DPRINT(suffix, inc); } fprintf(toE, "\n"); DPRINT("\n"); } @@ -610,7 +610,7 @@ main(int argc, char **argv) if(argc > 1 && argv[1][0] == '-') { sc = argv[1][1]; argc--; argv++; } if(argc < 2) { printf("usage is: U%cI2WB [debug] [-s] []\n", sc-32); exit(-1); } if(argc > 2) dir = argv[2]; - if(argc > 3) suffix = argv[3]; + if(argc > 3) strncpy(suffix, argv[3], 80); if(sc == 'x') nameWord = valueWord = bTime = "", wTime = "opp", bInc = "increment", wInc = "oppincrement", unit = 1000; // switch to UCCI keywords else if(sc == 'f' ) frc = -1, sc = 'c'; // UCI for unannounced Chess960