summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1999-11-25 15:57:54 +0000
committerjoerg <joerg@FreeBSD.org>1999-11-25 15:57:54 +0000
commitedb014178dc2becbad775401b190809c5530785e (patch)
treee52a11a6de3d3f75f81a954eb9a6820a306fa4cf
parent62276be7fd7cc397a1858c39f63f923ea148c05c (diff)
downloadFreeBSD-src-edb014178dc2becbad775401b190809c5530785e.zip
FreeBSD-src-edb014178dc2becbad775401b190809c5530785e.tar.gz
Don't coredump if can't write to the scorefile.
-rw-r--r--games/battlestar/com6.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/games/battlestar/com6.c b/games/battlestar/com6.c
index ec01b11..a22b0fb 100644
--- a/games/battlestar/com6.c
+++ b/games/battlestar/com6.c
@@ -29,6 +29,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
#ifndef lint
@@ -105,7 +107,12 @@ char ch;
struct timeval tv;
char *date;
time_t tvsec;
- int s = sigblock(sigmask(SIGINT));
+ int s;
+
+ if (score_fp == NULL)
+ return;
+
+ s = sigblock(sigmask(SIGINT));
gettimeofday(&tv, (struct timezone *)0); /* can't call time */
tvsec = (time_t) tv.tv_sec;
OpenPOWER on IntegriCloud