From 2e37959fec0a8931ec346a172ce3495ffe96e27e Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 22 Jan 2018 17:27:25 -0700 Subject: [PATCH] Better conversion from double to nanoseconds. --- plugins/sudoers/defaults.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.40.0