[Bf-committers] strcat/sprintf and sprintf/sprintf_s

Ben ben at half-dome.net
Sun Jan 8 17:30:00 CET 2006


Regards,

I'm not a very good coder, but I would like to help, so these were some 
things that I found that perhaps I could help with.

Firstly, like this: 
http://projects.blender.org/tracker/index.php?func=detail&aid=3283&group_id=9&atid=127 
there are some places in the code where sprintf + strcat could be 
replaced with a single += sprintf statement. Is this desirable?


Secondly, compiling under windows MSVC throws up a lot of errors along 
the lines of "sprintf is deprecated, consider using sprintf_s instead". 
Is this windows specific? If not, would it be helpful for me to go 
through replacing the functions?
       Related to that, the difference between sprintf and sprintf_s is 
that a buffer size is required. How I would source this is, if earlier 
in the function the buffer is defined as size x I would insert the 
number given into the sprintf_s function. If the number is not in the 
code, i would use sizeof(buffer). Is this the right way?



Thanks,
Ben Stabler



More information about the Bf-committers mailing list