X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=lasker-2.2.3%2Fsrc%2Ftimeseal.c;h=baeea063e13fafd9706eba7e686d1a4d5dcb9d90;hb=d144f1dbc10b60e2ebf9f1b39d0d5900b177a43f;hp=4f9b942e1b4e18a3d63d0e759aa91dfa8ad03c6c;hpb=76f1e81b3426b94e1d80c9daa309f78045e5335b;p=capablanca.git diff --git a/lasker-2.2.3/src/timeseal.c b/lasker-2.2.3/src/timeseal.c index 4f9b942..baeea06 100644 --- a/lasker-2.2.3/src/timeseal.c +++ b/lasker-2.2.3/src/timeseal.c @@ -31,9 +31,11 @@ static unsigned decode(unsigned char *s) char line[1024]; char *p; unsigned t = 0; + + snprintf(line, 1000, "%s", s); // [HGM] limit length to 1000, to prevent crashing timeseal decoder /* send the encoded data to the decoder process */ - dprintf(timeseal_globals.decoder_conn, "%s\n", s); + dprintf(timeseal_globals.decoder_conn, "%s\n", line); if (!fd_gets(line, sizeof(line), timeseal_globals.decoder_conn)) { d_printf("Bad result from timeseal decoder? (t=%u)\n", t); @@ -176,7 +178,7 @@ void ExecuteFlagCmd(int p, struct connection_t *con) pcommand(pp->opponent, "flag"); } } else if (pp->side == BLACK) { - gg->bRealTime -= con->time - gg->wTimeWhenReceivedMove; + gg->bRealTime -= con->time - gg->bTimeWhenReceivedMove; gg->bTimeWhenReceivedMove = con->time; if (gg->bRealTime < 0) { pcommand(pp->opponent, "flag");