From: Steinar H. Gunderson Date: Sun, 14 Dec 2014 10:17:07 +0000 (+0100) Subject: Set unknown Elos to zero; we can handle them now. X-Git-Url: https://git.sesse.net/?p=pgn-extract;a=commitdiff_plain;h=62fac85f587619ad81f27eae3ef2703f376a8b04 Set unknown Elos to zero; we can handle them now. --- diff --git a/output.c b/output.c index 83054d4..bb9ee77 100644 --- a/output.c +++ b/output.c @@ -1196,15 +1196,16 @@ output_sesse_bin_game(Game current_game,FILE *outputfile, return; } - // Find Black and White Elos. Skip games with no Elo. + // Find Black and White Elos. const char *white_elo_tag = current_game.tags[WHITE_ELO_TAG]; const char *black_elo_tag = current_game.tags[BLACK_ELO_TAG]; - if (white_elo_tag == NULL || black_elo_tag == NULL) { - return; + int white_elo = 0, black_elo = 0; + if (white_elo_tag) { + white_elo = atoi(white_elo_tag); + } + if (black_elo_tag) { + black_elo = atoi(black_elo_tag); } - - int white_elo = atoi(white_elo_tag); - int black_elo = atoi(black_elo_tag); int file_num = current_game.file_number; long start_position = current_game.start_position;