diff --git a/src/libb64/cdecode.c b/src/libb64/cdecode.c index 0d86d0e..e135da2 100644 --- a/src/libb64/cdecode.c +++ b/src/libb64/cdecode.c @@ -9,6 +9,10 @@ For details, see http://sourceforge.net/projects/libb64 #include #endif +#if defined(ESP32) +#define CORE_HAS_LIBB64 +#endif + #ifndef CORE_HAS_LIBB64 #include "cdecode_inc.h" @@ -32,9 +36,9 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex const char* codechar = code_in; char* plainchar = plaintext_out; char fragment; - + *plainchar = state_in->plainchar; - + switch (state_in->step) { while (1) diff --git a/src/libb64/cencode.c b/src/libb64/cencode.c index 7367135..afe1463 100644 --- a/src/libb64/cencode.c +++ b/src/libb64/cencode.c @@ -9,6 +9,10 @@ For details, see http://sourceforge.net/projects/libb64 #include #endif +#if defined(ESP32) +#define CORE_HAS_LIBB64 +#endif + #ifndef CORE_HAS_LIBB64 #include "cencode_inc.h" @@ -35,9 +39,9 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, char* codechar = code_out; char result; char fragment; - + result = state_in->result; - + switch (state_in->step) { while (1) @@ -76,7 +80,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, *codechar++ = base64_encode_value(result); result = (fragment & 0x03f) >> 0; *codechar++ = base64_encode_value(result); - + ++(state_in->stepcount); if (state_in->stepcount == CHARS_PER_LINE/4) { @@ -92,7 +96,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, int base64_encode_blockend(char* code_out, base64_encodestate* state_in) { char* codechar = code_out; - + switch (state_in->step) { case step_B: @@ -108,7 +112,7 @@ int base64_encode_blockend(char* code_out, base64_encodestate* state_in) break; } *codechar++ = 0x00; - + return codechar - code_out; }