Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


swprintf confusion
Urkle Offline
FG - Associate

Posts: 1,172
Threads: 31
Joined: Jul 2006
Reputation: 21
#2
RE: swprintf confusion

swprintf is a PAIN. The Correct (ISO C defintion) version is supposed to have a count parameter, but M$ has an incompatible version that doesn't.. Read this doc about the mess.. Now since we are compiling in C++ mode VS *should* be loading in both versions as overloads and the compiler should compile using the ISO C variant (which is SAFER as you are telling it how big the buffer is.. so no buffer overflows).

A way to ensure that C++ version gets loaded is to change the include header to include <cstdio> instead of <stdio.h> and then add a using std; line in the code (or just call std:Confusedwprintf() );

http://msdn.microsoft.com/en-us/library/...71%29.aspx

Developing away on one of
Multiple Macs running 10.6, 10.7, 10.8, and 10.9.
Linux, 8-core AMD, 8GB RAM, Fedora 18, nVidia 450 1GB
05-17-2010, 02:25 PM
Website Find


Messages In This Thread
swprintf confusion - by RobRendell - 05-17-2010, 01:09 PM
RE: swprintf confusion - by Urkle - 05-17-2010, 02:25 PM
RE: swprintf confusion - by Urkle - 05-17-2010, 04:00 PM
RE: swprintf confusion - by RobRendell - 05-17-2010, 10:39 PM



Users browsing this thread: 1 Guest(s)