summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-11-04 10:25:03 +0000
committerMatt Caswell <matt@openssl.org>2016-11-04 12:09:46 +0000
commitff04799d904ec2bfcfc3a3ca656549db2dec9068 (patch)
tree1c338f08537d42cb1d0c392ac50a644076f01f89
parented9fa2c74bbb9da312aa82865aeb3f9b75a8167b (diff)
Fix some style issues from libssl size_tify review
Reviewed-by: Rich Salz <rsalz@openssl.org>
-rw-r--r--ssl/packet_locl.h12
-rw-r--r--ssl/record/rec_layer_s3.c6
2 files changed, 7 insertions, 11 deletions
diff --git a/ssl/packet_locl.h b/ssl/packet_locl.h
index ec31a331d2..94933c1a07 100644
--- a/ssl/packet_locl.h
+++ b/ssl/packet_locl.h
@@ -164,9 +164,8 @@ __owur static ossl_inline int PACKET_get_net_2(PACKET *pkt, unsigned int *data)
__owur static ossl_inline int PACKET_get_net_2_len(PACKET *pkt, size_t *data)
{
unsigned int i;
- int ret;
+ int ret = PACKET_get_net_2(pkt, &i);
- ret = PACKET_get_net_2(pkt, &i);
if (ret)
*data = (size_t)i;
@@ -206,9 +205,8 @@ __owur static ossl_inline int PACKET_get_net_3(PACKET *pkt, unsigned long *data)
__owur static ossl_inline int PACKET_get_net_3_len(PACKET *pkt, size_t *data)
{
unsigned long i;
- int ret;
+ int ret = PACKET_get_net_3(pkt, &i);
- ret = PACKET_get_net_3(pkt, &i);
if (ret)
*data = (size_t)i;
@@ -249,9 +247,8 @@ __owur static ossl_inline int PACKET_get_net_4(PACKET *pkt, unsigned long *data)
__owur static ossl_inline int PACKET_get_net_4_len(PACKET *pkt, size_t *data)
{
unsigned long i;
- int ret;
+ int ret = PACKET_get_net_4(pkt, &i);
- ret = PACKET_get_net_4(pkt, &i);
if (ret)
*data = (size_t)i;
@@ -285,9 +282,8 @@ __owur static ossl_inline int PACKET_get_1(PACKET *pkt, unsigned int *data)
__owur static ossl_inline int PACKET_get_1_len(PACKET *pkt, size_t *data)
{
unsigned int i;
- int ret;
+ int ret = PACKET_get_1(pkt, &i);
- ret = PACKET_get_1(pkt, &i);
if (ret)
*data = (size_t)i;
diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c
index a20bc3ef21..779a29fddd 100644
--- a/ssl/record/rec_layer_s3.c
+++ b/ssl/record/rec_layer_s3.c
@@ -276,7 +276,7 @@ int ssl3_read_n(SSL *s, size_t n, size_t max, int extend, int clearold,
/* else we need to read more data */
- if (n > (rb->len - rb->offset)) { /* does not happen */
+ if (n > rb->len - rb->offset) { /* does not happen */
SSLerr(SSL_F_SSL3_READ_N, ERR_R_INTERNAL_ERROR);
return -1;
}
@@ -288,7 +288,7 @@ int ssl3_read_n(SSL *s, size_t n, size_t max, int extend, int clearold,
else {
if (max < n)
max = n;
- if (max > (rb->len - rb->offset))
+ if (max > rb->len - rb->offset)
max = rb->len - rb->offset;
}
@@ -610,7 +610,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, size_t len,
return i;
}
- if ((tmpwrit == n) ||
+ if (tmpwrit == n ||
(type == SSL3_RT_APPLICATION_DATA &&
(s->mode & SSL_MODE_ENABLE_PARTIAL_WRITE))) {
/*