\r
static const bool UseDebug = FALSE;\r
\r
-static const int StringSize = 4096;\r
+#define StringSize ((int)4096)\r
\r
// variables\r
\r
// uci_set_threads()\r
\r
void uci_set_threads(uci_t * uci, int n) {\r
- ASSERT(n>=1);\r
const char *thread_option=uci_thread_option(uci);\r
+ ASSERT(n>=1);\r
if(thread_option){\r
uci_send_option(uci,thread_option,"%d",n);\r
}\r
uci->best_depth = 0;\r
uci->best_sel_depth = 0;\r
line_clear(uci->best_pv);\r
-\r
- uci->node_nb = 0;\r
+// make the default 1 instead of 0 so that info lines can be recognized by their node number 0\r
+ uci->node_nb = 1;\r
uci->time = 0.0;\r
uci->speed = 0.0;\r
uci->cpu = 0.0;\r
}else if(my_string_case_equal(argument,"Resign")){\r
event |= EVENT_RESIGN;\r
}else{\r
- strcpy(uci->info,argument);\r
+ snprintf(uci->info,sizeof(uci->info),"%s",argument);\r
+ uci->info[sizeof(uci->info)-1]='\0';\r
event|=EVENT_INFO;\r
}\r
// TODO: argument to EOS\r
} else {\r
\r
my_log("POLYGLOT unknown option \"%s\" for command \"%s\"\n",option,command);\r
- // this is for buggy engines; it should probably be protected\r
+ // This should probably be protected\r
// by a "WorkAround" option.\r
- strcpy(uci->info,option);\r
- strcat(uci->info," ");\r
- strcat(uci->info,argument);\r
+ snprintf(uci->info,sizeof(uci->info),"%s %s",option,argument);\r
+ uci->info[sizeof(uci->info)-1]='\0';\r
event|=EVENT_INFO;\r
}\r
}\r