try to write code like thi
WCHAR w[4]
w[0]=L'?'
w[1]=L'?'
w[2]=L'?'
w[3]=L'?'
int iret= _vsnwprintf(w,L"1234",4,NULL/*or any correct address*/)
iret will be equeal 4 - however _vsnwprintf doesn't write terminating null-char to the end of the string
is it correct? may be it must return -1 = too small buffer? ( seems VC6 RUNTIME do exactly this
LarryWest42 - 13 May 2004 21:36 GMT
Tragically, none of the *sn*printf() functions are guaranteed to null-terminate
Microsoft does provide StrSafe.h which has a bunch of functions and such to help with this kind of problem. Hopefully someday these (or equivalents) will be in the C/C++ standard libraries
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsecure/html/s
trsafe.as
Larr