aboutsummaryrefslogtreecommitdiff
path: root/libparse/clk_trimtsip.c
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2019-03-07 13:01:16 +0000
committerCy Schubert <cy@FreeBSD.org>2019-03-07 13:01:16 +0000
commit360c01464aee3bc4c520898a675f35967db09ac2 (patch)
treec244e3f6baebbb7d13d8dd0d4ee570773cb3c579 /libparse/clk_trimtsip.c
parentc7f4d2332394d5600fe4e14c530ede36b0ff29b0 (diff)
downloadsrc-360c01464aee3bc4c520898a675f35967db09ac2.tar.gz
src-360c01464aee3bc4c520898a675f35967db09ac2.zip
Import 4.2.8p13.vendor/ntp/4.2.8p13
Notes
Notes: svn path=/vendor/ntp/dist/; revision=344878 svn path=/vendor/ntp/4.2.8p13/; revision=344879; tag=vendor/ntp/4.2.8p13
Diffstat (limited to 'libparse/clk_trimtsip.c')
-rw-r--r--libparse/clk_trimtsip.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/libparse/clk_trimtsip.c b/libparse/clk_trimtsip.c
index 64359efa0b32..8cf5660657cc 100644
--- a/libparse/clk_trimtsip.c
+++ b/libparse/clk_trimtsip.c
@@ -265,9 +265,7 @@ cvt_trimtsip(
clock_time->flags = PARSEB_POWERUP;
return CVT_OK;
}
- if (week < GPSWRAP) {
- week += GPSWEEKS;
- }
+ week = basedate_expand_gpsweek(week);
/* time OK */
@@ -351,14 +349,12 @@ cvt_trimtsip(
int tls = t->t_gpsutc = (u_short) getshort((unsigned char *)&mb(12)); /* current leap correction (GPS-UTC) */
int tlsf = t->t_gpsutcleap = (u_short) getshort((unsigned char *)&mb(24)); /* new leap correction */
- t->t_weekleap = (u_short) getshort((unsigned char *)&mb(20)); /* week no of leap correction */
- if (t->t_weekleap < GPSWRAP)
- t->t_weekleap = (u_short)(t->t_weekleap + GPSWEEKS);
+ t->t_weekleap = basedate_expand_gpsweek(
+ (u_short) getshort((unsigned char *)&mb(20))); /* week no of leap correction */
t->t_dayleap = (u_short) getshort((unsigned char *)&mb(22)); /* day in week of leap correction */
- t->t_week = (u_short) getshort((unsigned char *)&mb(18)); /* current week no */
- if (t->t_week < GPSWRAP)
- t->t_week = (u_short)(t->t_weekleap + GPSWEEKS);
+ t->t_week = basedate_expand_gpsweek(
+ (u_short) getshort((unsigned char *)&mb(18))); /* current week no */
lbp = (unsigned char *)&mb(14); /* last update time */
if (fetch_ieee754(&lbp, IEEE_SINGLE, &t0t, trim_offsets) != IEEE_OK)