From 2602330223adcc5c0f5d52fb3e2c5738cd35e942 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 11 Apr 2015 13:32:25 -0400 Subject: [PATCH] Resolved snwprintf() issues once and for all. Thanks to cousteau, dorp, and kate in irc.freenode.net/##c. --- new/init_windows.c | 4 +--- new/main_windows.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/new/init_windows.c b/new/init_windows.c index ed0bf6a..7ebe4e2 100644 --- a/new/init_windows.c +++ b/new/init_windows.c @@ -40,9 +40,7 @@ static const char *loadLastError(const char *message) wmessage = toUTF16(message); n = _scwprintf(initErrorFormat, initErrorArgs); wstr = (WCHAR *) uiAlloc((n + 1) * sizeof (WCHAR), "WCHAR[]"); - // TODO this requires -lmsvcr100; find out if that runs on XP RTM/SP1 - // TODO find replacement - swprintf_s(wstr, n + 1, initErrorFormat, initErrorArgs); + snwprintf(wstr, n + 1, initErrorFormat, initErrorArgs); str = toUTF8(wstr); uiFree(wstr); if (hassysmsg) diff --git a/new/main_windows.c b/new/main_windows.c index 0b6b407..bd973b7 100644 --- a/new/main_windows.c +++ b/new/main_windows.c @@ -1,7 +1,7 @@ // 6 april 2015 #include "uipriv_windows.h" -// #qo LDFLAGS: -luser32 -lkernel32 -lgdi32 -luxtheme -lmsimg32 -lcomdlg32 -lole32 -loleaut32 -loleacc -luuid -lmsvcr100 +// #qo LDFLAGS: -luser32 -lkernel32 -lgdi32 -luxtheme -lmsimg32 -lcomdlg32 -lole32 -loleaut32 -loleacc -luuid static void uimsgloop_else(MSG *msg) {