From 89b367941e12b1163afa517eeddca1b5ecd2a054 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 4 Feb 2023 16:30:48 +0100 Subject: libtar: some minor cleanups - Use is_memory_zero from libutil - Move checksum update function to tar writer code - Move checksum verify function to tar reader code - Only export the function to compute the checksum Signed-off-by: David Oberhollenzer --- lib/tar/src/write_header.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/tar/src/write_header.c') diff --git a/lib/tar/src/write_header.c b/lib/tar/src/write_header.c index b0711b3..5d98686 100644 --- a/lib/tar/src/write_header.c +++ b/lib/tar/src/write_header.c @@ -9,6 +9,13 @@ #include "internal.h" #include +static void update_checksum(tar_header_t *hdr) +{ + sprintf(hdr->chksum, "%06o", tar_compute_checksum(hdr)); + hdr->chksum[6] = '\0'; + hdr->chksum[7] = ' '; +} + static void write_binary(char *dst, sqfs_u64 value, int digits) { memset(dst, 0, digits); -- cgit v1.2.3