summaryrefslogtreecommitdiff
path: root/test/helpers/ssltestlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/helpers/ssltestlib.c')
-rw-r--r--test/helpers/ssltestlib.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/helpers/ssltestlib.c b/test/helpers/ssltestlib.c
index 13564a08a7..727ba7ff6a 100644
--- a/test/helpers/ssltestlib.c
+++ b/test/helpers/ssltestlib.c
@@ -349,8 +349,7 @@ static int mempacket_test_read(BIO *bio, char *out, int outl)
unsigned int seq, offset, len, epoch;
BIO_clear_retry_flags(bio);
- if (sk_MEMPACKET_num(ctx->pkts) <= 0
- || (thispkt = sk_MEMPACKET_value(ctx->pkts, 0)) == NULL
+ if ((thispkt = sk_MEMPACKET_value(ctx->pkts, 0)) == NULL
|| thispkt->num != ctx->currpkt) {
/* Probably run out of data */
BIO_set_retry_read(bio);
@@ -603,9 +602,8 @@ int mempacket_test_inject(BIO *bio, const char *in, int inl, int pktnum,
ctx->lastpkt++;
do {
i++;
- if (i < sk_MEMPACKET_num(ctx->pkts)
- && (nextpkt = sk_MEMPACKET_value(ctx->pkts, i)) != NULL
- && nextpkt->num == ctx->lastpkt)
+ nextpkt = sk_MEMPACKET_value(ctx->pkts, i);
+ if (nextpkt != NULL && nextpkt->num == ctx->lastpkt)
ctx->lastpkt++;
else
return inl;