X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=uci.c;h=f78fb2c0473ae50e5a5cd14a72700dc575c87575;hb=a7db862b2f44d23b358a1319cd8a374cf88c24fd;hp=5eeda2b5ebc83639d60a0fa1cbbf052b45abaa76;hpb=952edaa8941552b9d0faef8d06161f44c2cc83fd;p=xboard.git diff --git a/uci.c b/uci.c index 5eeda2b..f78fb2c 100644 --- a/uci.c +++ b/uci.c @@ -26,10 +26,6 @@ #include #include -#if HAVE_MALLOC_H - #include -#endif - #include "common.h" #include "backend.h" Boolean GetArgValue(char *a); @@ -55,8 +51,8 @@ void InitEngineUCI( const char * iniDir, ChessProgramState * cps ) if(cps == &second) { // change options for first into those for second engine if(strstr(buf, "first") == buf) sprintf(argName, "second%s", buf+5); else if(buf[0] == 'f') sprintf(argName, "s%s", buf+1); else - strcpy(argName, buf); - } else strcpy(argName, buf); + safeStrCpy(argName, buf, sizeof(argName)/sizeof(argName[0])); + } else safeStrCpy(argName, buf, sizeof(argName)/sizeof(argName[0])); if(GetArgValue(argName)) { // look up value of option with this name s = argName; while(*s) *q++ = *s++;