epan: don't print nanoseconds if seconds isn't representable.

Fix for previous fixes to #17179.


(cherry picked from commit 4715f5021c)
This commit is contained in:
Guy Harris 2021-01-28 07:56:22 +00:00
parent 9bcc1785c1
commit 1b22b8ed51
1 changed files with 2 additions and 2 deletions

View File

@ -1332,10 +1332,10 @@ ek_write_field_value(field_info *fi, write_json_data* pdata)
#endif
if (tm != NULL) {
strftime(time_string, sizeof(time_string), "%FT%T", tm);
json_dumper_value_anyf(pdata->dumper, "\"%s.%uZ\"", time_string, t->nsecs);
} else {
g_snprintf(time_string, sizeof(time_string), "Not representable");
json_dumper_value_anyf(pdata->dumper, "\"Not representable\"");
}
json_dumper_value_anyf(pdata->dumper, "\"%s.%uZ\"", time_string, t->nsecs);
break;
default:
dfilter_string = fvalue_to_string_repr(NULL, &fi->value, FTREPR_DISPLAY, fi->hfinfo->display);