Jump to content
  • Advertisement
Sign in to follow this  
Garlin

Untitled

This topic is 3631 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey Guys Perhaps someone can help me. My app is running fine in Debug mode but in Release it seems as though any sprintf_s/wsprintf_s functions are not working. The buffers are all allocated properly, but sprintf is coping rubbish data into the buffer. Any ideas? I'm using VS2005. Code is nothing complex... char test[256]; memset(test, 0, 256); sprintf_s(test, "%s testtext", "text"); 'test' after that is rubbish. It also seems as though it has something to to with optimizations. If I disable optimizations or change it to Minimize Size then it seems to work. But it doesn't work all the time. What could be going wrong there?

Share this post


Link to post
Share on other sites
Advertisement
How do you "check" your buffer. Do you actually output the buffer using cout, or set a breakpoint and check the value.
I suppose you're doing the latter, wich will always result in garbage. You can use breakpoints in a release build, but you won't be able to really debug your application, only in debug builds.

Share this post


Link to post
Share on other sites
I've even used a message box. The data is defiantly ribbish.

Lets use the other thread with the correct title.

Thanks.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!