]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug2100] conversion timespec/timeval <--> l_fp fixed
authorJuergen Perlinger <perlinger@ntp.org>
Fri, 30 Dec 2011 11:17:49 +0000 (12:17 +0100)
committerJuergen Perlinger <perlinger@ntp.org>
Fri, 30 Dec 2011 11:17:49 +0000 (12:17 +0100)
bk: 4efd9ddd1fg1Hfr2fDgv9DXGgpSvzA

ChangeLog
libntp/timespecops.c
libntp/timevalops.c

index 7484f612b0350fb6eeb049a1611282e048984610..2db1471199d51d123e7e0fc323787d7b139a2c92 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+* [Bug2100] conversio timespec/timeval <--> l_fp fixed; added tests to
+  expose the bug
 (4.2.7p244) 2011/12/25 Released by Harlan Stenn <stenn@ntp.org>
 (4.2.7p243) 2011/12/23 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2095] ntptrace now needs 'rv' instead of 'pstat', reported
index bbbabc6cc0635083613611b349e044bc20d4e00f..8ccb9644cb1da46232963ded656c27a09155eefe 100644 (file)
@@ -325,8 +325,8 @@ timespec_relfromlfp(
        neg = L_ISNEG(&tmp);
        if (neg != 0)
                L_NEG(&tmp);    
-       MYFTOTVN(x->l_uf, out.tv_nsec);
-       out.tv_sec = x->l_ui;
+       MYFTOTVN(tmp.l_uf, out.tv_nsec);
+       out.tv_sec = tmp.l_ui;
        if (neg != 0) {
                out.tv_sec  = -out.tv_sec;
                out.tv_nsec = -out.tv_nsec;
index d524c87b7cdf5b76980f7d32a3d3984eeadc288f..2de9688970909a67731d001808029526f9a0234e 100644 (file)
@@ -317,8 +317,8 @@ timeval_relfromlfp(
        neg = L_ISNEG(&tmp);
        if (neg != 0)
                L_NEG(&tmp);    
-       MYFTOTVU(x->l_uf, out.tv_usec);
-       out.tv_sec = x->l_ui;
+       MYFTOTVU(tmp.l_uf, out.tv_usec);
+       out.tv_sec = tmp.l_ui;
        if (neg != 0) {
                out.tv_sec = -out.tv_sec;
                out.tv_usec = -out.tv_usec;