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.


#ActualParadigm Shifter

Posted 22 June 2013 - 01:09 PM

You are freeing it once per iteration of the loop.

 

Free it after the loop finishes all its iterations (i.e. outside the while).

 

Even better, just have a local variable buffer instead.

 

char buffer[2049] = { '\0' };

 

EDIT: Ninja'd. I didn't notice the '0' bit either, that's completely wrong ;) Use '\0'.


#1Paradigm Shifter

Posted 22 June 2013 - 01:08 PM

You are freeing it once per iteration of the loop.

 

Free it after the loop finishes all its iterations (i.e. outside the while).

 

Even better, just have a local variable buffer instead.

 

char buffer[2049] = { '\0' };


PARTNERS