]> git.sesse.net Git - pgn-extract/commitdiff
Set unknown Elos to zero; we can handle them now.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Dec 2014 10:17:07 +0000 (11:17 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 14 Dec 2014 10:17:07 +0000 (11:17 +0100)
output.c

index 83054d418b27e4afb1ff182d6a1f23000fc70182..bb9ee772c58f1fca6323ebca8241e04cfa3a97d6 100644 (file)
--- 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;