From a2b9b23ba507724920376cd13a0839abcfc1ac61 Mon Sep 17 00:00:00 2001 From: kcwu Date: Tue, 30 Aug 2005 03:29:51 +0000 Subject: warn user if file is unable to open. git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3117 63ad8ddf-47c3-0310-b6dd-a9e9d9715204 --- mbbsd/chess.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mbbsd/chess.c') 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); -- cgit v1.2.3