From 59dafa077b77b8b35d0bf3d7524ffc129721cd16 Mon Sep 17 00:00:00 2001 From: alexander <> Date: Wed, 7 Jul 2004 07:16:16 +0000 Subject: [PATCH] Endian conversion mistakenly done before fraction math; ok henning@ --- src/usr.sbin/ntpd/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usr.sbin/ntpd/util.c b/src/usr.sbin/ntpd/util.c index ba44545a..e218aea5 100644 --- a/src/usr.sbin/ntpd/util.c +++ b/src/usr.sbin/ntpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.4 2004/07/05 19:53:21 otto Exp $ */ +/* $OpenBSD: util.c,v 1.5 2004/07/07 07:16:16 alexander Exp $ */ /* * Copyright (c) 2004 Alexander Guy @@ -58,7 +58,7 @@ d_to_lfp(double d) struct l_fixedpt lfp; lfp.int_part = htonl(d); - lfp.fraction = htonl((d - lfp.int_part) * UINT_MAX); + lfp.fraction = htonl((d - (u_int32_t)d) * UINT_MAX); return (lfp); }