From: Todd C. Miller Date: Tue, 23 Jan 2018 00:27:25 +0000 (-0700) Subject: Better conversion from double to nanoseconds. X-Git-Tag: SUDO_1_8_23^2~190 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e37959fec0a8931ec346a172ce3495ffe96e27e;p=sudo Better conversion from double to nanoseconds. --- diff --git a/plugins/sudoers/defaults.c b/plugins/sudoers/defaults.c index ce7d6a83d..cfb9abb37 100644 --- a/plugins/sudoers/defaults.c +++ b/plugins/sudoers/defaults.c @@ -870,7 +870,7 @@ store_timespec(const char *str, union sudo_defs_val *sd_un) /* Convert from minutes to seconds and nanoseconds. */ d *= 60.0; sd_un->tspec.tv_sec = (time_t)d; - sd_un->tspec.tv_nsec = (long)(d - sd_un->tspec.tv_sec) * 1000000000L; + sd_un->tspec.tv_nsec = (long)((d - sd_un->tspec.tv_sec) * 1000000000.0); } debug_return_bool(true); }