From 362d2a2d6837b22feac393223c151508de6362d7 Mon Sep 17 00:00:00 2001 From: TakayukiMatsuo Date: Wed, 24 Feb 2021 01:07:45 +0900 Subject: [PATCH] Moved int pos declaration at the top the func --- src/bio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bio.c b/src/bio.c index 74535614e..d3bf6e4fe 100644 --- a/src/bio.c +++ b/src/bio.c @@ -1441,9 +1441,10 @@ int wolfSSL_BIO_seek(WOLFSSL_BIO *bio, int ofs) } int wolfSSL_BIO_tell(WOLFSSL_BIO* bio) { - WOLFSSL_ENTER("wolfSSL_BIO_tell"); int pos; + WOLFSSL_ENTER("wolfSSL_BIO_tell"); + if (bio == NULL) { return -1; } @@ -1452,8 +1453,8 @@ int wolfSSL_BIO_tell(WOLFSSL_BIO* bio) return 0; } - pos =(int) XFTELL((XFILE)bio->ptr); - if(pos < 0) + pos = (int)XFTELL((XFILE)bio->ptr); + if (pos < 0) return -1; else return pos;