summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmateweather/test_sun_moon.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libmateweather/test_sun_moon.c b/libmateweather/test_sun_moon.c
index 9ee1fd7..a3ab787 100644
--- a/libmateweather/test_sun_moon.c
+++ b/libmateweather/test_sun_moon.c
@@ -71,10 +71,14 @@ main (int argc, char **argv)
fabs(latitude), (latitude >= 0. ? 'N' : 'S'),
fabs(longitude), (longitude >= 0. ? 'E' : 'W'),
asctime(gmtime(&info.update)));
- printf("sunrise: %s",
- (info.sunriseValid ? ctime(&info.sunrise) : "(invalid)\n"));
- printf("sunset: %s",
- (info.sunsetValid ? ctime(&info.sunset) : "(invalid)\n"));
+
+ if (bsun) {
+ printf("sunrise: %s",
+ (info.sunriseValid ? ctime(&info.sunrise) : "(invalid)\n"));
+ printf("sunset: %s",
+ (info.sunsetValid ? ctime(&info.sunset) : "(invalid)\n"));
+ }
+
if (bmoon) {
printf("moonphase: %g\n", info.moonphase);
printf("moonlat: %g\n", info.moonlatitude);