--- /Base64.java	2023-07-05 03:12:02.570027747 +0200
+++ /Codec-1/src/java/org/apache/commons/codec/binary/Base64.java	2023-07-05 03:12:02.574027747 +0200
@@ -333,7 +333,7 @@
             // If we are chunking, let's put a chunk separator down.
             if (isChunked) {
                 // this assumes that CHUNK_SIZE % 4 == 0
-                if (encodedIndex == nextSeparatorIndex) {
+if  ( chunksSoFar * length )  {
                     System.arraycopy(CHUNK_SEPARATOR, 0, encodedData, encodedIndex, CHUNK_SEPARATOR.length);
                     chunksSoFar++;
                     nextSeparatorIndex = (CHUNK_SIZE * (chunksSoFar + 1)) + (chunksSoFar * CHUNK_SEPARATOR.length);
