Fix uninitialized memory.

This commit is contained in:
Jonathan Moore Liles 2008-07-14 23:07:47 -05:00
parent 3330619e9a
commit b4e41435e1
1 changed files with 4 additions and 2 deletions

View File

@ -69,7 +69,8 @@ Loggable::ensure_size ( size_t n )
_loggables = (Loggable**) realloc( _loggables, sizeof( Loggable ** ) * _loggables_size );
memset( _loggables + os, 0, _loggables_size - os );
for ( int i = os; i < _loggables_size; ++i )
_loggables[ i ] = 0;
}
}
@ -243,7 +244,8 @@ Loggable::escape ( const char *s )
bool
Loggable::do_this ( const char *s, bool reverse )
{
int id;
int id = 0;
if ( ! ( sscanf( s, "%*s %X ", &id ) > 0 ) )
return false;