X-Git-Url: https://git.sesse.net/?p=remoteglot-book;a=blobdiff_plain;f=binloader.cpp;h=730f59279eba946af8073826b08cf775564cf994;hp=acf14d7c9d3dd79d0bf436c4ab4c772f3540a889;hb=f3225963af3ef8bf33b49d5b51a37d36f47e1482;hpb=33d7fcf900b9c456aea2fc88900fe3c7dd4344e8 diff --git a/binloader.cpp b/binloader.cpp index acf14d7..730f592 100644 --- a/binloader.cpp +++ b/binloader.cpp @@ -98,7 +98,7 @@ void write_subshard(const char *basename, ShardData* shard, int bucket) c.set_pgn_file_num(e.file_num); c.set_pgn_start_position(e.start_position); } - if (!moves.count(e.move)) { + if (strlen(e.move) > 0 && !moves.count(e.move)) { moves.insert(e.move); c.add_move(e.move); } @@ -214,7 +214,9 @@ int main(int argc, char **argv) // exit(1); break; } - if (fread(&move[0], l, 1, fp) != 1) { + if (l == 0) { + move[0] = 0; + } else if (fread(&move[0], l, 1, fp) != 1) { perror("fread()"); // exit(1); break;