Hi All,
Using the latest update to the mingw-w64 packages in Cygwin, I've run
in to an issue where swprintf is truncating an included string. In my
code i have:
wcscpy(method, TEXT("Logoff"));
swprintf(messageText, TEXT("Are you sure you want to %s?"), method);
which results in "Are you sure you want to L?". I'm trying to create
a simple test case to illustrate the issue, but this code works:
$ cat test.cpp
#define UNICODE 1
#include <windows.h>
#include <stdio.h>
int main(void)
{
WCHAR test[20], teststr[4096], tmp[4096];
wcscpy(test, TEXT("test"));
swprintf(teststr, TEXT("This is a %s"), test);
MessageBox(GetDesktopWindow(), teststr, L"Test", MB_OK | MB_TOPMOST);
return 0;
}
When compiled with:
i686-w64-mingw32-g++ test.cpp -o test
I'm still trying to track down what is options are causing the
truncation, but I figured I'd raise it now in case someone can offer
some pointers as to where to look in terms of tracking down the issue.
Cheers,
Chris
--
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public