diff options
-rw-r--r-- | mbbsd/chess.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mbbsd/chess.c b/mbbsd/chess.c index e9eca609..7a350aab 100644 --- a/mbbsd/chess.c +++ b/mbbsd/chess.c @@ -1105,6 +1105,11 @@ ChessReplayGame(const char* fname) char buf[256]; screen_backup_t oldscreen; + if(fp == NULL) { + vmsg("檔案無法開啟, 可能被刪除了"); + return -1; + } + while (found == -1 && fgets(buf, sizeof(buf), fp)) { if (buf[0] == '<') { const int line_len = strlen(buf); |