mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-02 04:34:18 +01:00
Use brackets around shift operations
Use `( x >> y ) & z` instead of `x >> y & z`. Both are equivalent by operator precedence, but the former is more readable and the commonly used idiom in the library.
This commit is contained in:
parent
b001e08585
commit
e2e2b9ea8b
@ -192,9 +192,9 @@ static int ssl_save_session( const mbedtls_ssl_session *session,
|
|||||||
if( left < 3 + cert_len )
|
if( left < 3 + cert_len )
|
||||||
return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL );
|
||||||
|
|
||||||
*p++ = (unsigned char)( cert_len >> 16 & 0xFF );
|
*p++ = (unsigned char)( ( cert_len >> 16 ) & 0xFF );
|
||||||
*p++ = (unsigned char)( cert_len >> 8 & 0xFF );
|
*p++ = (unsigned char)( ( cert_len >> 8 ) & 0xFF );
|
||||||
*p++ = (unsigned char)( cert_len & 0xFF );
|
*p++ = (unsigned char)( ( cert_len ) & 0xFF );
|
||||||
|
|
||||||
if( session->peer_cert != NULL )
|
if( session->peer_cert != NULL )
|
||||||
memcpy( p, session->peer_cert->raw.p, cert_len );
|
memcpy( p, session->peer_cert->raw.p, cert_len );
|
||||||
|
Loading…
Reference in New Issue
Block a user