Jump to content

  • Log In with Google      Sign In   
  • Create Account

Debug Assertion Failed:(L"Buffer is too small"&&0)


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 DrunkKong   Members   -  Reputation: 100

Like
0Likes
Like

Posted 25 April 2012 - 01:15 AM

Hi to alll Devs.
Sorry i've been stuck for a few hours in here....
Ive got a not working little game that i must make it to work.
There is no errors now but the one attached.. i'v been looking around but nothing clear.

the last chage i made and maybe is that the problem. was in

swprintf_s( strBuffer, 512, strMsg, args );

identifier not found for swprintf_s.

so I add #include <wchar.h> in the header to make it work as seen that the little game use this instead of <stdio.h>.


Please help!!.

Any clue pointing or fresh ideas are more than welcome.

Thanks in advance for all your time.

Attached Thumbnails

  • debug.jpg


Sponsor:

#2 jbcode3   Members   -  Reputation: 156

Like
0Likes
Like

Posted 25 April 2012 - 01:51 AM

What is the size of

strBuffer?



#3 DrunkKong   Members   -  Reputation: 100

Like
0Likes
Like

Posted 25 April 2012 - 02:02 AM

sorry

512

#4 DrunkKong   Members   -  Reputation: 100

Like
0Likes
Like

Posted 25 April 2012 - 02:03 AM

<code>
void TextRenderer::DrawFormattedTextLine( const WCHAR* strMsg, int x, int y, D3DXCOLOR colour, ... )
{
WCHAR strBuffer[512];

va_list args;
va_start( args, strMsg );
swprintf_s( strBuffer, 512, strMsg, args );
strBuffer[511] = L'\0';
va_end( args );

DrawTextLine( strBuffer, x, y, colour );
}
</code>

#5 DrunkKong   Members   -  Reputation: 100

Like
0Likes
Like

Posted 25 April 2012 - 02:56 AM

Thanks, wrong size of the buffer, as u said.

Really appreciate the super fast response.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS