Protect against empty program name.

This commit is contained in:
Bartosz Taudul 2024-05-30 13:59:12 +02:00
parent 608ff35c8c
commit 207e065ffe
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -36,6 +36,8 @@ UserData::UserData( const char* program, uint64_t time )
: m_program( program ) : m_program( program )
, m_time( time ) , m_time( time )
{ {
if( m_program.empty() ) m_program = "_";
FILE* f = OpenFile( FileDescription, false ); FILE* f = OpenFile( FileDescription, false );
if( f ) if( f )
{ {
@ -54,6 +56,8 @@ void UserData::Init( const char* program, uint64_t time )
assert( !Valid() ); assert( !Valid() );
m_program = program; m_program = program;
m_time = time; m_time = time;
if( m_program.empty() ) m_program = "_";
} }
bool UserData::SetDescription( const char* description ) bool UserData::SetDescription( const char* description )