Skip to content

Commit

Permalink
Merge pull request #69 from tobozo/1.2.0
Browse files Browse the repository at this point in the history
1.2.0
  • Loading branch information
tobozo authored Oct 13, 2023
2 parents b171e5d + ef82b3a commit d476771
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions examples/Test_tar_gz_tgz/test_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ extern "C" {

#endif
#if defined ESP32
#if defined ESP_IDF_VERSION_MAJOR && ESP_IDF_VERSION_MAJOR >= 4
#if defined ESP_IDF_VERSION_MAJOR && ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MAJOR < 5
#include <esp32/rom/rtc.h>
#else
#include <rom/rtc.h>
#endif
#endif

#pragma GCC diagnostic ignored "-Wswitch"

bool isManualReset()
{
Expand Down Expand Up @@ -89,7 +90,7 @@ void SerialPrintCentered(const char *s, bool open = false, bool close = false )
if( open ) Serial.println( OpenLine );
Serial.println( out );
if( close ) Serial.println( CloseLine );
delete out;
delete[] out;
}

void SerialPrintfCentered(const char* format, ... )
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ESP32-targz
version=1.1.9
version=1.2.0
author=tobozo <[email protected]>
maintainer=tobozo <[email protected]>
sentence=A library to unpack/uncompress tar, gz, and tar.gz files on ESP32 and ESP8266
Expand Down
6 changes: 3 additions & 3 deletions src/ESP32-targz-lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ void BaseUnpacker::hexDumpData( const char* buff, size_t buffsize, uint32_t outp
}
}
Serial.println( byteToStr + bytesStr + " " + binaryStr );
delete byteToStr;
delete[] byteToStr;
}


Expand All @@ -401,7 +401,7 @@ void BaseUnpacker::hexDumpFile( fs::FS &fs, const char* filename, uint32_t outpu
hexDumpData( buff, bytes_read, output_size );
bytes_read = binFile.readBytes( buff, output_size );
}
delete buff;
delete[] buff;
} else {
Serial.printf("Ignoring file %s (%d bytes)", filename, binFile.size() );
}
Expand Down Expand Up @@ -1359,7 +1359,7 @@ int GzUnpacker::gzUncompress( bool isupdate, bool stream_to_tar, bool use_dict,
output_position = 0;
}

if( isupdate && outlen > 0 ) {
if( isupdate && outlen > 0 ) { // Update requirement: written output size must be a multiple of SPI_FLASH_SEC_SIZE
size_t updatable_size = ( outlen + SPI_FLASH_SEC_SIZE-1 ) & ~( SPI_FLASH_SEC_SIZE-1 );
size_t zerofill_size = updatable_size - outlen;
if( zerofill_size <= SPI_FLASH_SEC_SIZE ) {
Expand Down

0 comments on commit d476771

Please sign in to comment.