On 2015-04-12 03:31, Luka Perkov wrote: > The base code has been taken from zstream project which was > written by Steven Barth. > > Signed-off-by: Luka Perkov <[email protected]> > CC: Steven Barth <[email protected]> Your v2 patch did not properly consider my comments on v1. I'll repeat them with some added clarifications.
I think output *buffers* (not just pointers to output buffer pointers) should be passed in by the caller, and the functions should return size_t. Your functions should not do any memory allocation at all! You could then add an inline function that returns the maximum output buffer size for encode/decode. Example: size_t b64decode(void *out, const void *in, size_t len); size_t b64encode(void *out, const void *in, size_t len); static inline int b64_decode_size(size_t in); static inline int b64_encode_size(size_t in); b64decode() should also be able to handle in == out, i.e. working within the same buffer. - Felix _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
