2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2025-01-15 04:50:03 +01:00

engine: client: try to not save passwords to console history

This commit is contained in:
Alibek Omarov 2024-06-13 21:23:49 +03:00
parent 3434005e66
commit b102727320

View File

@ -1446,7 +1446,15 @@ static void Con_SaveHistory( con_history_t *self )
f = FS_Open( "console_history.txt", "wb", true );
for( i = historyStart; i < self->next; i++ )
FS_Printf( f, "%s\n", self->lines[i % CON_HISTORY].buffer );
{
const char *s = self->lines[i % CON_HISTORY].buffer;
// HACKHACK: don't save lines that have something that looks like a password
if( Q_stristr( s, "password" ) || Q_stristr( s, "_pw" ))
continue;
FS_Printf( f, "%s\n", s );
}
FS_Close( f );
}