Jump to content
  • Advertisement
Sign in to follow this  
perfectly_dark

Problem with fread()

This topic is 4886 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

Hello all, I'm having a peculiar problem. I'm reading in a TGA image file, and i've noticed that when the first byte of the stream is 0 fread() fills the pointer provided with nothing (The debugger shows the pointer contents as "") but returns the correct number of bytes read. What's going on here? Any solutions/explanations? Thanks in advance! Dave

Share this post


Link to post
Share on other sites
Advertisement
It's probably not filling the buffer with nothing, it's just that the debugger is interpreting the pointer as a normal C-string pointer, which is null terminated. If the first character is 0, then the debugger will show it as "" no matter what follows it.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!