mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
6755d8c271
commit
c4691306c4
1 changed files with 7 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue