diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/helpers/ssltestlib.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/helpers/ssltestlib.c b/test/helpers/ssltestlib.c index 7dfb7befd0..4c17faea54 100644 --- a/test/helpers/ssltestlib.c +++ b/test/helpers/ssltestlib.c @@ -350,8 +350,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); @@ -521,9 +520,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; |