summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b8530b9)
raw | patch | inline | side by side (parent: b8530b9)
author | Neil Wilson <neil@aldur.co.uk> | |
Thu, 23 Feb 2017 17:03:34 +0000 (17:03 +0000) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Mon, 4 Sep 2017 09:49:16 +0000 (11:49 +0200) |
Stop the scaling calculation dropping the sign of the underlying value
Fixes: #2188
Fixes: #2188
src/ntpd.c | patch | blob | history |
diff --git a/src/ntpd.c b/src/ntpd.c
index 1cb59dee56db698165b0221660e670b5b7d15284..4ed4e7c8f2625430821ce71baefddac7ee2b6f94 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
}
/* kerninfo -> estimated error */
- offset_loop = scale_loop * ((gauge_t)ntohl(ik->offset));
+ offset_loop = (gauge_t)((int32_t)ntohl(ik->offset) * scale_loop);
freq_loop = ntpd_read_fp(ik->freq);
- offset_error = scale_error * ((gauge_t)ntohl(ik->esterror));
+ offset_error = (gauge_t)((int32_t)ntohl(ik->esterror) * scale_error);
DEBUG("info_kernel:\n"
" pll offset = %.8g\n"