Changeset 11717


Ignore:
Timestamp:
Jan 19, 2011, 9:50:51 PM (12 years ago)
Author:
jordan
Message:

(trunk libT) minor code tweak to crypto.c's tr_sha1() function

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/crypto.c

    r11716 r11717  
    4040    va_list vl;
    4141    SHA_CTX sha;
     42    const void * content;
    4243
    4344    SHA1_Init( &sha );
     
    4546
    4647    va_start( vl, content1_len );
    47     for( ;; )
    48     {
    49         const void * content = va_arg( vl, const void* );
    50         const int    content_len = content ? va_arg( vl, int ) : -1;
    51         if( content == NULL || content_len < 1 )
    52             break;
    53         SHA1_Update( &sha, content, content_len );
    54     }
     48    while(( content = va_arg( vl, const void* )))
     49        SHA1_Update( &sha, content, va_arg( vl, int ) );
    5550    va_end( vl );
     51
    5652    SHA1_Final( setme, &sha );
    5753}
Note: See TracChangeset for help on using the changeset viewer.