Fix some warnings
[xboard.git] / uci.c
diff --git a/uci.c b/uci.c
index f78fb2c..55aaff5 100644 (file)
--- a/uci.c
+++ b/uci.c
@@ -23,6 +23,7 @@
  * ------------------------------------------------------------------------
  */
 #include <stdio.h>
+#include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -36,6 +37,7 @@ void InitEngineUCI( const char * iniDir, ChessProgramState * cps )
         char *p, *q;
         char polyglotCommand[MSG_SIZ];
 
+        if(cps->isUCI == 2) p = appData.ucciAdapter; else
         p = appData.adapterCommand;
         q = polyglotCommand;
         while(*p) {
@@ -46,7 +48,7 @@ void InitEngineUCI( const char * iniDir, ChessProgramState * cps )
               *s++ = cps == &first ? 'f' : 's';
               p++;
             }
-            while(*p >= '0' && *p) *s++ = *p++; // copy option name
+            while(isdigit(*p) || isalpha(*p)) *s++ = *p++; // copy option name
             *s = NULLCHAR;
             if(cps == &second) { // change options for first into those for second engine
               if(strstr(buf, "first") == buf) sprintf(argName, "second%s", buf+5); else