From cfad4a71f653a87a930ff70a646b96ad5ac4e63e Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 8 Sep 2020 05:56:01 +0200 Subject: [PATCH] clearer logic --- src/base64.f90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/base64.f90 b/src/base64.f90 index 32ead69cd..3a02e9491 100644 --- a/src/base64.f90 +++ b/src/base64.f90 @@ -112,7 +112,7 @@ pure subroutine decode_base64(bytes,base64_str) c = 1_pLongInt b = 1_pLongInt - do while(.True.) + do while(b <= bytesLen+3_pLongInt .and. c <= base64Len+4_pLongInt) do p=0_pLongInt,3_pLongInt if(c+p<=len(base64_str,kind=pLongInt)) then charPos(p) = int(merge(index(encoding,base64_str(c+p:c+p))-1, 0, base64_str(c+p:c+p) /= '='),C_SIGNED_CHAR) @@ -135,7 +135,6 @@ pure subroutine decode_base64(bytes,base64_str) endif b = b+3_pLongInt c = c+4_pLongInt - if(b>bytesLen+3_pLongInt .or. c > base64Len+4_pLongInt) exit enddo end subroutine decode_base64