From 152c96032da477af26fab758d999904169b11d31 Mon Sep 17 00:00:00 2001 From: Martin Fleisz Date: Thu, 14 Jul 2022 09:29:05 +0200 Subject: [PATCH] channel/printer: Fix return type for localtime_s on Windows --- channels/printer/client/win/printer_win.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/channels/printer/client/win/printer_win.c b/channels/printer/client/win/printer_win.c index bbc6ce4b2..48702c2b0 100644 --- a/channels/printer/client/win/printer_win.c +++ b/channels/printer/client/win/printer_win.c @@ -75,22 +75,23 @@ static WCHAR* printer_win_get_printjob_name(size_t id) { time_t tt; struct tm tres; - struct tm* t; + errno_t err; WCHAR* str; size_t len = 1024; int rc; tt = time(NULL); - t = localtime_s(&tres, &tt); + err = localtime_s(&tres, &tt); str = calloc(len, sizeof(WCHAR)); if (!str) return NULL; - rc = swprintf_s( - str, len, - WIDEN("FreeRDP Print %04d-%02d-%02d% 02d-%02d-%02d - Job %") WIDEN(PRIuz) WIDEN("\0"), - t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec, id); + rc = swprintf_s(str, len, + WIDEN("FreeRDP Print %04d-%02d-%02d% 02d-%02d-%02d - Job %") WIDEN(PRIuz) + WIDEN("\0"), + tres.tm_year + 1900, tres.tm_mon + 1, tres.tm_mday, tres.tm_hour, tres.tm_min, + tres.tm_sec, id); return str; }