mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 06:35:06 -05:00
util: simplify clamping in UTI_TimespecNetworkToHost()
This should fix a coverity warning.
This commit is contained in:
2
util.c
2
util.c
@@ -856,7 +856,7 @@ UTI_TimespecNetworkToHost(Timespec *src, struct timespec *dest)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsec = ntohl(src->tv_nsec);
|
nsec = ntohl(src->tv_nsec);
|
||||||
dest->tv_nsec = CLAMP(0U, nsec, 999999999U);
|
dest->tv_nsec = MIN(nsec, 999999999U);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|||||||
Reference in New Issue
Block a user