From: Juergen Perlinger Date: Fri, 30 Dec 2011 11:17:49 +0000 (+0100) Subject: [Bug2100] conversion timespec/timeval <--> l_fp fixed X-Git-Tag: NTP_4_2_7P245~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5641fa1f378cc25d56fce6585124dc34a603393e;p=thirdparty%2Fntp.git [Bug2100] conversion timespec/timeval <--> l_fp fixed bk: 4efd9ddd1fg1Hfr2fDgv9DXGgpSvzA --- diff --git a/ChangeLog b/ChangeLog index 7484f612b..2db147119 100644 --- 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 (4.2.7p243) 2011/12/23 Released by Harlan Stenn * [Bug 2095] ntptrace now needs 'rv' instead of 'pstat', reported diff --git a/libntp/timespecops.c b/libntp/timespecops.c index bbbabc6cc..8ccb9644c 100644 --- a/libntp/timespecops.c +++ b/libntp/timespecops.c @@ -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; diff --git a/libntp/timevalops.c b/libntp/timevalops.c index d524c87b7..2de968897 100644 --- a/libntp/timevalops.c +++ b/libntp/timevalops.c @@ -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;