From 0f9107bef348f853c01668048d386f9445fe851a Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Tue, 10 Sep 2019 22:15:23 +0200 Subject: Fixed timezone conversion --- example/ndpiReader.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'example') diff --git a/example/ndpiReader.c b/example/ndpiReader.c index 117537f83..2dde10182 100644 --- a/example/ndpiReader.c +++ b/example/ndpiReader.c @@ -1110,8 +1110,9 @@ static void printFlow(u_int16_t id, struct ndpi_flow_info *flow, u_int16_t threa if(flow->ssh_tls.notBefore && flow->ssh_tls.notAfter) { char notBefore[32], notAfter[32]; - struct tm *before = gmtime(&flow->ssh_tls.notBefore); - struct tm *after = gmtime(&flow->ssh_tls.notAfter); + struct tm a, b; + struct tm *before = gmtime_r(&flow->ssh_tls.notBefore, &a); + struct tm *after = gmtime_r(&flow->ssh_tls.notAfter, &b); strftime(notBefore, sizeof(notBefore), "%F %T", before); strftime(notAfter, sizeof(notAfter), "%F %T", after); -- cgit v1.2.3