aboutsummaryrefslogtreecommitdiffstats
path: root/epan/print.c
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2021-07-17 14:48:03 +0100
committerJoão Valverde <j@v6e.pt>2021-09-22 14:28:49 +0100
commit8d59f81729f967a2e0fd17b6860655ddd921a63a (patch)
tree206bb8ac78686cbf1aed259be96717906b39ef62 /epan/print.c
parentc4265865c2e14db2b35d9d790ceaac925d766422 (diff)
MinGW-w64: Replace incompatible format for strftime()
Replace %F and %T in the format string. These specifiers are just short-hand so just write them in full.
Diffstat (limited to 'epan/print.c')
-rw-r--r--epan/print.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/print.c b/epan/print.c
index 722e741502..eb023a154a 100644
--- a/epan/print.c
+++ b/epan/print.c
@@ -1365,7 +1365,8 @@ ek_write_field_value(field_info *fi, write_json_data* pdata)
tm = gmtime_r(&t->secs, &tm_time);
#endif
if (tm != NULL) {
- strftime(time_string, sizeof(time_string), "%FT%T", tm);
+ /* Some platforms (MinGW-w64) do not support %F or %T. */
+ strftime(time_string, sizeof(time_string), "%Y-%m-%dT%H:%M:%S", tm);
json_dumper_value_anyf(pdata->dumper, "\"%s.%09uZ\"", time_string, t->nsecs);
} else {
json_dumper_value_anyf(pdata->dumper, "\"Not representable\"");