diff options
-rw-r--r-- | src/main.c | 17 |
1 files changed, 3 insertions, 14 deletions
@@ -19,6 +19,8 @@ #include <string.h> #include <time.h> +#define SECONDS_IN_DAY 86400; + /** * Prints the helptext @@ -46,19 +48,6 @@ void usage() { /** - * Converts the given day count to seconds (multiplies by the number of seconds - * in a day, 86400). - * - * @param days Day count to convert to seconds - * - * @return long Number of total seconds in the given day duration - */ -long days_to_seconds(int days) { - return days * 86400; -} - - -/** * Writes the current timestamp to the specified lastlogin file * * @param path Path to the lastlogin file @@ -178,7 +167,7 @@ int main(int argc, char* argv[]) { // Set time-related values now = time(NULL); - threshold = days_to_seconds(days); + threshold = days * SECONDS_IN_DAY; lastlogin = fread_long(lastlogin_path); if(lastlogin == -1) { |