summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-10-24 13:42:36 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-10-24 14:36:03 -0700
commitc4691306c40dedc61110174dde15310c359abb6a (patch)
tree456a8b4bc48fcf390488b8c95ea572658b3afff1 /parse-xml.c
parent6755d8c271511491b8a23b5e56705beca6fd2822 (diff)
downloadsubsurface-c4691306c40dedc61110174dde15310c359abb6a.tar.gz
Avoid using strptime
It's less portable (missing on Windows, for example) and it's kind of overkill here - the same is easily done with a sscanf. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 1b0c44985..c44b6f6ae 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -783,8 +783,14 @@ static void uemis_ts(char *buffer, void *_when)
struct tm tm;
time_t *when = _when;
- strptime(buffer, "%Y-%m-%dT%H:%M:%S", &tm);
+ memset(&tm, 0, sizeof(tm));
+ sscanf(buffer,"%d-%d-%dT%d:%d:%d",
+ &tm.tm_year, &tm.tm_mon, &tm.tm_mday,
+ &tm.tm_hour, &tm.tm_min, &tm.tm_sec);
+ tm.tm_mon -= 1;
+ tm.tm_year -= 1900;
*when = utc_mktime(&tm);
+
}
static void uemis_duration(char *buffer, void *_duration)