Show differencesHistory of post edits
#ActualKhatharr
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())?
#1Khatharr
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.
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.