diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-12 05:01:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-12 05:01:23 +0000 |
commit | a05990c6c7250ba0aaed94e0222b598e0190bad4 (patch) | |
tree | c3661f2aea2badd5ef62949469ccb98935c8e20b /tempcomp.c | |
parent | Adding debian version 4.5-3. (diff) | |
download | chrony-a05990c6c7250ba0aaed94e0222b598e0190bad4.tar.xz chrony-a05990c6c7250ba0aaed94e0222b598e0190bad4.zip |
Merging upstream version 4.6.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tempcomp.c')
-rw-r--r-- | tempcomp.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -66,10 +66,9 @@ get_tempcomp(double temp) return k0 + (temp - T0) * k1 + (temp - T0) * (temp - T0) * k2; /* Otherwise interpolate/extrapolate between two nearest points */ - - for (i = 1; i < ARR_GetSize(points); i++) { - p2 = (struct Point *)ARR_GetElement(points, i); - if (p2->temp >= temp) + for (i = 1; ; i++) { + p2 = ARR_GetElement(points, i); + if (p2->temp >= temp || i + 1 >= ARR_GetSize(points)) break; } p1 = p2 - 1; |