mirror of
https://github.com/transmission/transmission
synced 2025-01-31 11:23:40 +00:00
(trunk libT) minor code tweak to crypto.c's tr_sha1() function
This commit is contained in:
parent
6ae426696f
commit
4f6d46cf99
1 changed files with 4 additions and 8 deletions
|
@ -39,20 +39,16 @@ tr_sha1( uint8_t * setme, const void * content1, int content1_len, ... )
|
|||
{
|
||||
va_list vl;
|
||||
SHA_CTX sha;
|
||||
const void * content;
|
||||
|
||||
SHA1_Init( &sha );
|
||||
SHA1_Update( &sha, content1, content1_len );
|
||||
|
||||
va_start( vl, content1_len );
|
||||
for( ;; )
|
||||
{
|
||||
const void * content = va_arg( vl, const void* );
|
||||
const int content_len = content ? va_arg( vl, int ) : -1;
|
||||
if( content == NULL || content_len < 1 )
|
||||
break;
|
||||
SHA1_Update( &sha, content, content_len );
|
||||
}
|
||||
while(( content = va_arg( vl, const void* )))
|
||||
SHA1_Update( &sha, content, va_arg( vl, int ) );
|
||||
va_end( vl );
|
||||
|
||||
SHA1_Final( setme, &sha );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue