Do not free allocated data when clearing a string_buffer_t

darcs-hash:20060109171302-ac50b-eda104ad21a80c99cc5f31e71973bbc835635b90.gz
This commit is contained in:
axel 2006-01-10 03:13:02 +10:00
parent 8ed80deb6b
commit fef1e1db32

6
util.c
View file

@ -977,8 +977,10 @@ void sb_destroy( string_buffer_t * b )
void sb_clear( string_buffer_t * b ) void sb_clear( string_buffer_t * b )
{ {
free( b->buff ); wchar_t c=0;
sb_init( b ); b->used=0;
b_append( b, &c, sizeof( wchar_t));
b->used -= sizeof(wchar_t);
} }