xrdp-next/xrdp-0.9.14-log-snprintf.patch

19 lines
779 B
Diff

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:47:18.283542606 +1000
@@ -555,9 +555,11 @@
now_t = time(&now_t);
now = localtime(&now_t);
- snprintf(buff, 21, "[%.4d%.2d%.2d-%.2d:%.2d:%.2d] ", now->tm_year + 1900,
- 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] ",
+ 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);