use libbase64 macro to calculate base64 length (#2007)

This commit is contained in:
Marcel Kottmann
2018-11-19 17:01:38 +01:00
committed by Me No Dev
parent 3902aa4019
commit 259ff80d60
2 changed files with 1 additions and 11 deletions

View File

@ -37,8 +37,7 @@ extern "C" {
*/
String base64::encode(uint8_t * data, size_t length)
{
// base64 needs more size then the source data
size_t size = ((length * 1.6f) + 1);
size_t size = base64_encode_expected_len(length) + 1;
char * buffer = (char *) malloc(size);
if(buffer) {
base64_encodestate _state;