util: simplify clamping in UTI_TimespecNetworkToHost()

This should fix a coverity warning.
This commit is contained in:
Miroslav Lichvar 2017-08-15 10:53:02 +02:00
parent 702db726d3
commit a83f0d3cdc

2
util.c
View file

@ -856,7 +856,7 @@ UTI_TimespecNetworkToHost(Timespec *src, struct timespec *dest)
#endif
nsec = ntohl(src->tv_nsec);
dest->tv_nsec = CLAMP(0U, nsec, 999999999U);
dest->tv_nsec = MIN(nsec, 999999999U);
}
/* ================================================== */