Review corrections 4
- Try to follow english grammar in function documentation
- Fix too long line
- Remove additional brackets
- Follow mbedtls coding style in for-statement
diff --git a/library/sha256.c b/library/sha256.c
index 314cb2c..d0bf542 100644
--- a/library/sha256.c
+++ b/library/sha256.c
@@ -320,7 +320,7 @@
int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx,
unsigned char output[32] )
{
- int ret;
+ int ret, s_pos, o_pos;
uint32_t used;
uint32_t high, low;
@@ -367,7 +367,7 @@
* Output final state
*/
- for ( int s_pos = 0, o_pos = 0; s_pos < 7; s_pos++, o_pos += 4 )
+ for( s_pos = 0, o_pos = 0; s_pos < 7; s_pos++, o_pos += 4 )
{
mbedtls_platform_put_uint32_be( &output[o_pos], ctx->state[s_pos] );
}
diff --git a/library/ssl_cli.c b/library/ssl_cli.c
index 8ce1582..6b240af 100644
--- a/library/ssl_cli.c
+++ b/library/ssl_cli.c
@@ -281,8 +281,8 @@
}
p = mbedtls_platform_put_uint16_be( p, MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES );
- p = mbedtls_platform_put_uint16_be( p, ( elliptic_curve_len + 2 ) );
- p = mbedtls_platform_put_uint16_be( p, ( elliptic_curve_len ) );
+ p = mbedtls_platform_put_uint16_be( p, elliptic_curve_len + 2 );
+ p = mbedtls_platform_put_uint16_be( p, elliptic_curve_len );
MBEDTLS_SSL_BEGIN_FOR_EACH_SUPPORTED_EC_TLS_ID( tls_id )
p = mbedtls_platform_put_uint16_be( p, tls_id );
@@ -1706,7 +1706,8 @@
#endif /* !MBEDTLS_SSL_CONF_FIXED_MAJOR_VER */
}
- MBEDTLS_SSL_DEBUG_MSG( 3, ( "server hello, current time: %lu", (unsigned long)mbedtls_platform_get_uint32_be(&buf[2])) );
+ MBEDTLS_SSL_DEBUG_MSG( 3, ( "server hello, current time: %lu",
+ (unsigned long)mbedtls_platform_get_uint32_be(&buf[2])) );
memcpy( ssl->handshake->randbytes + 32, buf + 2, 32 );