Skip to content
Snippets Groups Projects
Commit 7dbb01b3 authored by deuce's avatar deuce
Browse files

Fix error in last commit.

parent 1950c9bf
Branches
Tags
No related merge requests found
......@@ -131,14 +131,16 @@ int b64_encode(char *target, size_t tlen, const char *source, size_t slen) {
FREE_AND_NULL(tmpbuf);
return(-1);
}
if(inp==inend)
done=1;
if (!done)
if (inp>=inend)
enc=buf;
else
enc=buf|((*inp & 0xF0) >> 4);
if(add_char(outp++, enc, done, outend)) {
FREE_AND_NULL(tmpbuf);
return(-1);
}
if(inp==inend)
done=1;
if (!done) {
buf=(*(inp++)<<2)&0x3C;
if (inp == inend)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment