Add a missing bp->b_score not null check - addresses Coverity CID 1003

This commit is contained in:
abs 2006-03-17 23:34:37 +00:00
parent 7122043ef9
commit b4f3ebd201
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: shots.c,v 1.5 2004/01/27 20:30:29 jsm Exp $ */ /* $NetBSD: shots.c,v 1.6 2006/03/17 23:34:37 abs Exp $ */
/* /*
* Copyright (c) 1983-2003, Regents of the University of California. * Copyright (c) 1983-2003, Regents of the University of California.
* All rights reserved. * All rights reserved.
@ -32,7 +32,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: shots.c,v 1.5 2004/01/27 20:30:29 jsm Exp $"); __RCSID("$NetBSD: shots.c,v 1.6 2006/03/17 23:34:37 abs Exp $");
#endif /* not lint */ #endif /* not lint */
# include <err.h> # include <err.h>
@ -338,7 +338,7 @@ move_normal_shot(bp)
message(pp, "Zing!"); message(pp, "Zing!");
if (bp->b_owner == NULL) if (bp->b_owner == NULL)
break; break;
message(bp->b_owner, message(bp->b_owner, bp->b_score &&
((bp->b_score->i_missed & 0x7) == 0x7) ? ((bp->b_score->i_missed & 0x7) == 0x7) ?
"My! What a bad shot you are!" : "My! What a bad shot you are!" :
"Missed him"); "Missed him");