1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-06-23 06:25:24 +00:00

A bug report indirectly suggested the base64 decode code was confusing (as the

treatment of padding was un-obvious), so added a comment explaining it.

svn path=/icecast/trunk/icecast/; revision=9075
This commit is contained in:
Michael Smith 2005-03-14 23:41:11 +00:00
parent d43484d49a
commit f28ded9fbb

View File

@ -463,6 +463,10 @@ char *util_base64_decode(unsigned char *input)
}
*out++ = vals[0]<<2 | vals[1]>>4;
/* vals[3] and (if that is) vals[2] can be '=' as padding, which is
looked up in the base64decode table as '-1'. Check for this case,
and output zero-terminators instead of characters if we've got
padding. */
if(vals[2] >= 0)
*out++ = ((vals[1]&0x0F)<<4) | (vals[2]>>2);
else