diff options
Diffstat (limited to 'src/redshift.c')
-rw-r--r-- | src/redshift.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/redshift.c b/src/redshift.c index e0221d5..b880457 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -28,6 +28,7 @@ #include <math.h> #include <locale.h> #include <errno.h> +#include <time.h> /* poll.h is not available on Windows but there is no Windows location provider using polling. On Windows, we just define some stubs to make things compile. @@ -210,7 +211,11 @@ get_seconds_since_midnight(double timestamp) { time_t t = (time_t)timestamp; struct tm tm; +#ifdef _WIN32 + localtime_s(&tm, &t); +#else localtime_r(&t, &tm); +#endif return tm.tm_sec + tm.tm_min * 60 + tm.tm_hour * 3600; } @@ -965,7 +970,7 @@ main(int argc, char *argv[]) options.scheme.dawn.end < 0 || options.scheme.dusk.start < 0 || options.scheme.dusk.end < 0) { - fputs(_("Partitial time-configuration not" + fputs(_("Partial time-configuration not" " supported!\n"), stderr); exit(EXIT_FAILURE); } |