aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2021-12-01 23:13:21 -0500
committerJohn Thacker <johnthacker@gmail.com>2021-12-02 14:19:49 +0000
commitaadf4efcbe06a96dba2e8eb8d600f3b9b73d9fa5 (patch)
treeac62ae13f6699984db3a5c5eae7a4eebe1c82be9 /epan/tvbuff.c
parent871895f95a3e9085424c91779b14a7ec589d55f4 (diff)
epan: Add ENC_ISO_8601_DATE_TIME_BASIC
Add the ISO 8601 Basic date time format as another string time option. This could be used for e.g. ASN.1 GeneralizedTime. Add tests for it.
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index e7ff264439..6c9f7dfe13 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -1796,6 +1796,11 @@ tvb_get_string_time(tvbuff_t *tvb, const gint offset, const gint length,
errno = 0;
end = ptr + num_chars;
}
+ } else if ((encoding & ENC_ISO_8601_DATE_TIME_BASIC) == ENC_ISO_8601_DATE_TIME_BASIC) {
+ if ((num_chars = iso8601_to_nstime(ns, ptr, ISO8601_DATETIME_BASIC))) {
+ errno = 0;
+ end = ptr + num_chars;
+ }
} else {
memset(&tm, 0, sizeof(tm));
tm.tm_isdst = -1;