From: Victor Julien Date: Wed, 27 Apr 2022 19:28:53 +0000 (+0200) Subject: time: reduce scope of static string X-Git-Tag: suricata-7.0.0-beta1~599 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3444aec724d31a206bf4446b6c72d61ecdbaf0ce;p=thirdparty%2Fsuricata.git time: reduce scope of static string --- diff --git a/src/util-time.c b/src/util-time.c index 5cfa38a340..3186435311 100644 --- a/src/util-time.c +++ b/src/util-time.c @@ -237,9 +237,9 @@ void CreateUtcIsoTimeString (const struct timeval *ts, char *str, size_t size) struct tm local_tm; memset(&local_tm, 0, sizeof(local_tm)); struct tm *t = (struct tm*)SCUtcTime(time, &local_tm); - char time_fmt[64] = { 0 }; if (likely(t != NULL)) { + char time_fmt[64] = { 0 }; strftime(time_fmt, sizeof(time_fmt), "%Y-%m-%dT%H:%M:%S", t); snprintf(str, size, time_fmt, ts->tv_usec); } else {