From b9f38139973e6a32f6c8caae7628428303dd37f0 Mon Sep 17 00:00:00 2001 From: Bojan Smojver Date: Mon, 31 Aug 2020 19:47:59 +1000 Subject: [PATCH] Adjust snprintf() log patch to use absolute values only. --- xrdp-0.9.14-log-snprintf.patch | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xrdp-0.9.14-log-snprintf.patch b/xrdp-0.9.14-log-snprintf.patch index 5b57019..41c5548 100644 --- a/xrdp-0.9.14-log-snprintf.patch +++ b/xrdp-0.9.14-log-snprintf.patch @@ -1,7 +1,7 @@ diff -ruN xrdp-0.9.14-v/common/log.c xrdp-0.9.14/common/log.c --- xrdp-0.9.14-v/common/log.c 2020-08-26 12:32:21.000000000 +1000 -+++ xrdp-0.9.14/common/log.c 2020-08-31 19:23:06.347581743 +1000 -@@ -555,9 +555,10 @@ ++++ xrdp-0.9.14/common/log.c 2020-08-31 19:47:18.283542606 +1000 +@@ -555,9 +555,11 @@ now_t = time(&now_t); now = localtime(&now_t); @@ -9,9 +9,10 @@ diff -ruN xrdp-0.9.14-v/common/log.c xrdp-0.9.14/common/log.c - now->tm_mon + 1, now->tm_mday, now->tm_hour, now->tm_min, - now->tm_sec); + snprintf(buff, 21, "[%.4d%.2d%.2d-%.2d:%.2d:%.2d] ", -+ (now->tm_year + 1900) % 10000, -+ (now->tm_mon + 1) % 100, now->tm_mday % 100, now->tm_hour % 100, -+ now->tm_min % 100, now->tm_sec % 100); ++ abs((now->tm_year + 1900) % 10000), ++ abs((now->tm_mon + 1) % 100), abs(now->tm_mday % 100), ++ abs(now->tm_hour % 100), abs(now->tm_min % 100), ++ abs(now->tm_sec % 100)); internal_log_lvl2str(lvl, buff + 20);