mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-09-22 04:15:54 -04: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:
parent
d43484d49a
commit
f28ded9fbb
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user