2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +00:00

Better conversion from double to nanoseconds.

This commit is contained in:
Todd C. Miller
2018-01-22 17:27:25 -07:00
parent 4c0c225062
commit 2e37959fec

View File

@@ -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);
}