Add a recent suggestion received in email.
[xboard.git] / backend.c
index e9ae20f..f28d863 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1455,6 +1455,16 @@ read_from_ics(isr, closure, data, count, error)
     int tkind;
     char *p;
 
+#ifdef WIN32
+    if (appData.debugMode) {
+      if (!error) {
+       fprintf(debugFP, "<ICS: ");
+       show_bytes(debugFP, data, count);
+       fprintf(debugFP, "\n");
+      }
+    }
+#endif
+
     if (count > 0) {
        /* If last read ended with a partial line that we couldn't parse,
           prepend it to the new read and try again. */
@@ -4361,7 +4371,8 @@ HandleMachineMove(message, cps)
                    }
                    strncpy(programStats.movelist, buf1,
                            sizeof(programStats.movelist));
-                   buf1[sizeof(programStats.movelist) - 1] = NULLCHAR;
+                   programStats.movelist[sizeof(programStats.movelist) - 1]
+                     = NULLCHAR;
                } else {
                    sprintf(programStats.movelist, " no PV\n");
                }