public: optimize MD5_Print function.

This commit is contained in:
Andrey Akhmichin
2020-09-03 20:58:57 +05:00
committed by Alibek Omarov
parent 5cdb35f508
commit 23ea7ecbcc
3 changed files with 31 additions and 5 deletions

View File

@@ -438,16 +438,12 @@ transform hash to hexadecimal printable symbols
char *MD5_Print( byte hash[16] )
{
static char szReturn[64];
char szChunk[10];
int i;
memset( szReturn, 0, 64 );
for( i = 0; i < 16; i++ )
{
Q_snprintf( szChunk, sizeof( szChunk ), "%02X", hash[i] );
Q_strncat( szReturn, szChunk, sizeof( szReturn ));
}
COM_Hex2String( hash[i], &szReturn[i * 2] );
return szReturn;
}