Fix Base64_SkipNewline such that tests pass

This commit is contained in:
Guido Vranken
2021-06-14 03:42:41 +02:00
parent fb366f063e
commit 220bfe9926

View File

@ -122,13 +122,11 @@ static WC_INLINE int Base64_SkipNewline(const byte* in, word32 *inLen, word32 *o
if (len == 0) { if (len == 0) {
return BUFFER_E; return BUFFER_E;
} }
curChar = in[j];
curChar = in[j++]; while (len > 1 && curChar == ' ') {
len--;
while (len && curChar == ' ') {
/* skip whitespace in the middle or end of line */ /* skip whitespace in the middle or end of line */
curChar = in[j++]; curChar = in[++j];
len--; len--;
} }
if (len && (curChar == '\r' || curChar == '\n')) { if (len && (curChar == '\r' || curChar == '\n')) {