Jump to content

  • Log In with Google      Sign In   
  • Create Account

#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