diff options
author | 2014-04-25 09:49:33 +0000 | |
---|---|---|
committer | 2014-04-25 09:49:33 +0000 | |
commit | 99689d67c3545fe8eb8643d92612a698e71b740b (patch) | |
tree | 5c16e0884e652994fc185208b398714794d5ade1 | |
parent | Kill in_localaddr(), one less usage of the global list of IPv4 addresses. (diff) | |
download | wireguard-openbsd-99689d67c3545fe8eb8643d92612a698e71b740b.tar.xz wireguard-openbsd-99689d67c3545fe8eb8643d92612a698e71b740b.zip |
test dt_min for invalid minute values instead of testing dt_sec twice
ok bmercer@
-rw-r--r-- | sys/arch/armv7/sunxi/sxirtc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/armv7/sunxi/sxirtc.c b/sys/arch/armv7/sunxi/sxirtc.c index d757c54db62..b0e0653bc93 100644 --- a/sys/arch/armv7/sunxi/sxirtc.c +++ b/sys/arch/armv7/sunxi/sxirtc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sxirtc.c,v 1.3 2013/11/06 19:03:07 syl Exp $ */ +/* $OpenBSD: sxirtc.c,v 1.4 2014/04/25 09:49:33 jsg Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * Copyright (c) 2013 Artturi Alm @@ -110,7 +110,7 @@ sxirtc_gettime(todr_chip_handle_t handle, struct timeval *tv) dt.dt_mon = reg >> 8 & 0x0f; dt.dt_year = (reg >> 16 & 0x3f) + 2010; /* 0xff on A20 */ - if (dt.dt_sec > 59 || dt.dt_sec > 59 || + if (dt.dt_sec > 59 || dt.dt_min > 59 || dt.dt_hour > 23 || dt.dt_wday > 6 || dt.dt_day > 31 || dt.dt_day == 0 || dt.dt_mon > 12 || dt.dt_mon == 0) @@ -129,7 +129,7 @@ sxirtc_settime(todr_chip_handle_t handle, struct timeval *tv) clock_secs_to_ymdhms(tv->tv_sec, &dt); - if (dt.dt_sec > 59 || dt.dt_sec > 59 || + if (dt.dt_sec > 59 || dt.dt_min > 59 || dt.dt_hour > 23 || dt.dt_wday > 6 || dt.dt_day > 31 || dt.dt_day == 0 || dt.dt_mon > 12 || dt.dt_mon == 0) |