diff options
Diffstat (limited to 'main/busybox/0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch')
-rw-r--r-- | main/busybox/0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/main/busybox/0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch b/main/busybox/0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch index 9bd5075454..3169bdff46 100644 --- a/main/busybox/0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch +++ b/main/busybox/0001-libbb-fix-time-parsing-of-CC-YY-MMDDhhmm-.SS.patch @@ -1,4 +1,4 @@ -From 1a3d9fb9074dc746326e6fa98c3eb499f6a6e048 Mon Sep 17 00:00:00 2001 +From c9ee7417d8d838c16bc2c270d4dbb5fdb9c8b786 Mon Sep 17 00:00:00 2001 From: Natanael Copa <ncopa@alpinelinux.org> Date: Thu, 19 May 2016 16:17:32 +0200 Subject: [PATCH] libbb: fix time parsing of [[CC]YY]MMDDhhmm[.SS] @@ -10,31 +10,21 @@ closes 8951 Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> --- - libbb/time.c | 4 ++++ - 1 file changed, 4 insertions(+) + libbb/time.c | 1 + + 1 file changed, 1 insertion(+) diff --git a/libbb/time.c b/libbb/time.c -index aa19a47..44dd4aa 100644 +index aa19a47..82e6cb1 100644 --- a/libbb/time.c +++ b/libbb/time.c -@@ -159,6 +159,8 @@ void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm) - &ptm->tm_hour, - &ptm->tm_min, - &end) >= 5) { -+ /* assume zero if [.SS] is not given */ -+ ptm->tm_sec = 0; - /* Adjust month from 1-12 to 0-11 */ - ptm->tm_mon -= 1; - if ((int)cur_year >= 50) { /* >= 1950 */ -@@ -181,6 +183,8 @@ void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm) - &ptm->tm_hour, - &ptm->tm_min, - &end) >= 5) { -+ /* assume zero if [.SS] is not given */ -+ ptm->tm_sec = 0; - ptm->tm_year -= 1900; /* Adjust years */ - ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */ +@@ -186,6 +186,7 @@ void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm) } else { + bb_error_msg_and_die(bb_msg_invalid_date, date_str); + } ++ ptm->tm_sec = 0; /* assume zero if [.SS] is not given */ + if (end == '.') { + /* xxx.SS */ + if (sscanf(strchr(date_str, '.') + 1, "%u%c", -- 2.8.2 |