From 51072e4b1d4596cdcf3c165285b9324314eb2b06 Mon Sep 17 00:00:00 2001 From: ruanshudong Date: Wed, 11 Oct 2023 16:45:52 +0800 Subject: [PATCH] fix tc_logger crash in arm 32 --- util/include/util/tc_logger.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/include/util/tc_logger.h b/util/include/util/tc_logger.h index 6c8c4877..4ad75df3 100644 --- a/util/include/util/tc_logger.h +++ b/util/include/util/tc_logger.h @@ -922,9 +922,9 @@ namespace tars TC_Port::localtime_r(&t, &tt); - const char *szFormat = (_bHasSquareBracket) ? ("[%04d-%02d-%02d %02d:%02d:%02d.%03ld]%s") : ("%04d-%02d-%02d %02d:%02d:%02d.%03ld%s"); + const char *szFormat = (_bHasSquareBracket) ? ("[%04d-%02d-%02d %02d:%02d:%02d.%03d]%s") : ("%04d-%02d-%02d %02d:%02d:%02d.%03d%s"); n += snprintf(c + n, len - n, szFormat, - tt.tm_year + 1900, tt.tm_mon + 1, tt.tm_mday, tt.tm_hour, tt.tm_min, tt.tm_sec, duration_in_ms % 1000, _sSepar.c_str()); + tt.tm_year + 1900, tt.tm_mon + 1, tt.tm_mday, tt.tm_hour, tt.tm_min, tt.tm_sec, (int)(duration_in_ms % 1000), _sSepar.c_str()); } else if (hasFlag(TC_Logger::HAS_TIME)) {