Compare commits
2 Commits
9a7629459e
...
d8faf424ad
Author | SHA1 | Date | |
---|---|---|---|
d8faf424ad | |||
240a4f2f1a |
@ -29,4 +29,6 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS minitar DESTINATION lib)
|
install(TARGETS minitar DESTINATION lib)
|
||||||
install(FILES minitar.h DESTINATION include)
|
install(FILES minitar.h DESTINATION include)
|
||||||
|
|
||||||
|
add_subdirectory(examples)
|
5
examples/CMakeLists.txt
Normal file
5
examples/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
add_executable(list EXCLUDE_FROM_ALL list.c)
|
||||||
|
target_link_libraries(list PRIVATE minitar)
|
||||||
|
|
||||||
|
add_executable(untar EXCLUDE_FROM_ALL untar.c)
|
||||||
|
target_link_libraries(untar PRIVATE minitar)
|
@ -203,7 +203,7 @@ uint32_t minitar_checksum_header(const struct tar_header* hdr)
|
|||||||
const uint8_t* ptr = (const uint8_t*)hdr;
|
const uint8_t* ptr = (const uint8_t*)hdr;
|
||||||
|
|
||||||
// Sum up all bytes in the header, as unsigned bytes...
|
// Sum up all bytes in the header, as unsigned bytes...
|
||||||
while (ptr < (const uint8_t*)hdr + sizeof *hdr)
|
while (ptr < (const uint8_t*)hdr + (sizeof *hdr - sizeof hdr->padding))
|
||||||
{
|
{
|
||||||
sum += *ptr;
|
sum += *ptr;
|
||||||
ptr++;
|
ptr++;
|
||||||
|
Loading…
Reference in New Issue
Block a user