Move "offset to command args" to InputCommand.
authorYann Dirson <ydirson@free.fr>
Sat, 9 Nov 2013 17:03:32 +0000 (18:03 +0100)
committerYann Dirson <ydirson@free.fr>
Sat, 9 Nov 2013 21:22:23 +0000 (22:22 +0100)
gnushogi/commondsp.c

index bb99864..1c6ae09 100644 (file)
@@ -1454,13 +1454,11 @@ TestPSpeed(short(*f) (short side), unsigned j)
 
 
 static void
-SetOppTime(char *s)
+SetOppTime(char *time)
 {
-    char *time;
     int m, t, sec;
 
     sec = 0;
-    time = &s[strlen("otime")];
     t = (int)strtol(time, &time, 10);
 
     if (*time == ':')
@@ -1489,12 +1487,10 @@ SetOppTime(char *s)
 
 
 static void
-SetMachineTime(char *s)
+SetMachineTime(char *time)
 {
-    char *time;
     int m, t, sec;
 
-    time = &s[strlen("time")];
     sec = 0;
     t = (int)strtol(time, &time, 10);
 
@@ -1759,11 +1755,11 @@ InputCommand(char *command)
         }
         else if (strcmp(s, "time") == 0)
         {
-            SetMachineTime(sx);
+            SetMachineTime(sx + strlen("time"));
         }
         else if (strcmp(s, "otime") == 0)
         {
-            SetOppTime(sx);
+            SetOppTime(sx + strlen("otime"));
         }
         else if (strcmp(s, "Awindow") == 0)
         {