add -Wbad-function-cast to +CPPFLAGS and fix two compiler warnings
[paraslash.git] / daemon.c
index 46eb8f1..67bc6f2 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -171,13 +171,15 @@ time_t server_uptime(enum uptime set_or_get)
 {
        static time_t startuptime;
        time_t now;
+       double diff;
 
        if (set_or_get == UPTIME_SET) {
                time(&startuptime);
                return 0;
        }
        time(&now);
-       return (time_t) difftime(now, startuptime);
+       diff = difftime(now, startuptime);
+       return (time_t) diff;
 }
 
 /**