Skip to content

Commit

Permalink
fix: Fixes fileCLI b85dump buffer sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Hui committed Feb 10, 2024
1 parent 55e4a96 commit 683d59b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/fileCLI/fileCLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ void FileCLI::dumpHex(void)
void base85dump(int fp, size_t file_len)
{
size_t file_idx = 0, bytes_read;
uint8_t byte_buffer[512];
char encoded_buffer[1024];
uint8_t byte_buffer[SF_PACKET_SIZE];
char encoded_buffer[SF_RECORD_SIZE];
size_t totalEncodedLen = 0;
size_t n_packets = 0;
size_t encodedLen = 0;
Expand All @@ -405,10 +405,10 @@ void base85dump(int fp, size_t file_len)
#if SF_UPLOAD_ENCODING == SF_UPLOAD_BASE85
encodedLen = bintob85(encoded_buffer, byte_buffer, bytes_read) - encodedBuffer;
#elif SF_UPLOAD_ENCODING == SF_UPLOAD_BASE64
encodedLen = 1024;
encodedLen = SF_RECORD_SIZE;
b64_encode(byte_buffer, bytes_read, encoded_buffer, &encodedLen);
#elif SF_UPLOAD_ENCODING == SF_UPLOAD_BASE64URL
encodedLen = 1024;
encodedLen = SF_RECORD_SIZE;
urlsafe_b64_encode(byte_buffer, bytes_read, encoded_buffer, &encodedLen);
#endif
totalEncodedLen += encodedLen;
Expand Down

0 comments on commit 683d59b

Please sign in to comment.