- avoid multipling a boolean value, use &&.

This commit is contained in:
mrg 2019-02-03 10:45:58 +00:00
parent cf075e4cab
commit 770680b518
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.32 2014/03/22 23:10:36 dholland Exp $ */
/* $NetBSD: main.c,v 1.33 2019/02/03 10:45:58 mrg Exp $ */
/*
* Copyright (c) 1980, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: main.c,v 1.32 2014/03/22 23:10:36 dholland Exp $");
__RCSID("$NetBSD: main.c,v 1.33 2019/02/03 10:45:58 mrg Exp $");
#endif
#endif /* not lint */
@ -465,7 +465,7 @@ main(int argc __unused, char **argv)
mflag = 0;
l = bar + 7 * cturn;
for (i = bar; i != l; i += cturn)
if (board[i] * cturn)
if (board[i] && cturn)
mflag++;
/* compute game value */

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_ubsan.c,v 1.1 2018/08/03 04:18:40 kamil Exp $ */
/* $NetBSD: t_ubsan.c,v 1.2 2019/02/03 10:45:58 mrg Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2018\
The NetBSD Foundation, inc. All rights reserved.");
__RCSID("$NetBSD: t_ubsan.c,v 1.1 2018/08/03 04:18:40 kamil Exp $");
__RCSID("$NetBSD: t_ubsan.c,v 1.2 2019/02/03 10:45:58 mrg Exp $");
#include <sys/types.h>
#include <sys/wait.h>
@ -376,7 +376,7 @@ test_mul_overflow_signed(void)
volatile int a = INT_MAX;
volatile int b = atoi("2");
raise((a * b) ? SIGSEGV : SIGBUS);
raise((a && b) ? SIGSEGV : SIGBUS);
}
UBSAN_TC_BODY(mul_overflow_signed, tc)