src/server.c

changeset 60
0c50aac49e55
parent 59
3fa1de896666
child 64
4eda5df55f86
equal deleted inserted replaced
59:3fa1de896666 60:0c50aac49e55
72 // preload PGN data before handshake 72 // preload PGN data before handshake
73 FILE *pgnfile = fopen(settings->continuepgn, "r"); 73 FILE *pgnfile = fopen(settings->continuepgn, "r");
74 if (pgnfile) { 74 if (pgnfile) {
75 int result = read_pgn(pgnfile, &continuegame, 75 int result = read_pgn(pgnfile, &continuegame,
76 &(settings->gameinfo)); 76 &(settings->gameinfo));
77 long position = ftell(pgnfile);
77 fclose(pgnfile); 78 fclose(pgnfile);
78 if (result) { 79 if (result) {
79 addstr("Invalid PGN file content.\n"); 80 printw("Invalid PGN file content at position %ld:\n%s\n",
81 position, pgn_error_str(result));
80 return 1; 82 return 1;
81 } 83 }
82 if (!is_game_running(&continuegame)) { 84 if (!is_game_running(&continuegame)) {
83 addstr("Game has ended. Use -S to analyze it.\n"); 85 addstr("Game has ended. Use -S to analyze it.\n");
84 return 1; 86 return 1;

mercurial