Fix error with creating scorefile
authorAndrey Chernov <ache@FreeBSD.org>
Tue, 25 Jan 1994 01:58:08 +0000 (01:58 +0000)
committerAndrey Chernov <ache@FreeBSD.org>
Tue, 25 Jan 1994 01:58:08 +0000 (01:58 +0000)
games/rogue/score.c

index f4fd5d4..275cf42 100644 (file)
@@ -206,7 +206,8 @@ short other;
 
        md_lock(1);
 
 
        md_lock(1);
 
-       if ((fp = fopen(_PATH_SCOREFILE, "r+")) == NULL) {
+       if (   (fp = fopen(_PATH_SCOREFILE, "r+")) == NULL
+           && (fp = fopen(_PATH_SCOREFILE, "w+")) == NULL) {
                message("cannot read/write/create score file", 0);
                sf_error();
        }
                message("cannot read/write/create score file", 0);
                sf_error();
        }