]> granicus.if.org Git - sudo/commitdiff
Better conversion from double to nanoseconds.
authorTodd C. Miller <Todd.Miller@sudo.ws>
Tue, 23 Jan 2018 00:27:25 +0000 (17:27 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Tue, 23 Jan 2018 00:27:25 +0000 (17:27 -0700)
plugins/sudoers/defaults.c

index ce7d6a83de333af6241214dac25f37bbff995926..cfb9abb373f9c835418ec3961ff8c8e0327ff5b9 100644 (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);
 }