Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Posted 21 January 2013 - 02:42 AM

Nothing's jumping out at me apart from the fact that you don't test the return from fopen(). If you walk through it with the debugger can you see anything unusual (such as a negative 1 from fsize() getting passed to malloc())?


Posted 21 January 2013 - 02:37 AM

ninja'd - one sec while I read that.


Posted 21 January 2013 - 02:36 AM

<pre class="_prettyXprint _lang-code _linenums:NaN"> fseek(file, 0, SEEK_END);
int fileLength = ftell(file);
fseek(file, 0, SEEK_SET);</pre><br />Remember to close your FILE pointer when you're done or you'll leak handles.