square/SocketRocket — pull request #110 by gregkrsak (2013-08-22 15:45:23+00:00)
Title: Adjusted implementation of b64_ntop

Based on my understanding of `b64_ntop`:

*BIND's resolv.h*
`int b64_ntop(uint8_t const *data, size_t datalength, char *encoded, size_t encodedsize);`

*SocketRocket's base64.h*
`extern int b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize);`

Your `srclength` parameter is being passed as + 1 too large.

I could totally be wrong about this; however, I ran into an issue when I tried to write an implementation based on the one currently in SocketRocket. Subtracting 1 fixed it for me. No offense taken if you don't accept the pull request.