From 8d80280ab9ac9ec17abd981990771ea9927767a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Thu, 25 Feb 2021 13:53:31 -0300 Subject: [PATCH] time/ISO8601: don't use glibc extension in strptime. Per the manual for strptime, %F is equivalent %Y-%m-%d, so use that directly. --- NEWS | 2 ++ src/time/ISO8601.cxx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 35fba5b78..dbd9cbe1a 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.22.7 (not yet released) +* protocol + - don't use glibc extension to parse time stamps * decoder - ffmpeg: fix build problem with FFmpeg 3.4 * storage diff --git a/src/time/ISO8601.cxx b/src/time/ISO8601.cxx index 067e4c4ee..edda7034e 100644 --- a/src/time/ISO8601.cxx +++ b/src/time/ISO8601.cxx @@ -185,7 +185,7 @@ ParseISO8601(const char *s) struct tm tm{}; /* parse the date */ - const char *end = strptime(s, "%F", &tm); + const char *end = strptime(s, "%Y-%m-%d", &tm); if (end == nullptr) { /* try without field separators */ end = strptime(s, "%Y%m%d", &tm);