From 25fc72e22ff4104d08f2f7c5acc252a84ebfcc40 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 10 Sep 2017 11:09:28 +0300 Subject: Do not save non-existent time Note that git storage still encodes the time into file name. Signed-off-by: Miika Turkia --- core/save-xml.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/save-xml.c b/core/save-xml.c index 84530a749..df6b99eb1 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -354,8 +354,9 @@ static void show_date(struct membuffer *b, timestamp_t when) put_format(b, " date='%04u-%02u-%02u'", tm.tm_year, tm.tm_mon + 1, tm.tm_mday); - put_format(b, " time='%02u:%02u:%02u'", - tm.tm_hour, tm.tm_min, tm.tm_sec); + if (tm.tm_hour || tm.tm_min || tm.tm_sec) + put_format(b, " time='%02u:%02u:%02u'", + tm.tm_hour, tm.tm_min, tm.tm_sec); } static void save_samples(struct membuffer *b, struct dive *dive, struct divecomputer *dc) -- cgit v1.2.3-70-g09d2