From 4116634f4c6599d1d390dbb71c0c138291663955 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 4 Feb 2023 18:36:29 +0100 Subject: libtar: internalize the declaration of read_octal Use read_number in the places that remain. Signed-off-by: David Oberhollenzer --- lib/tar/src/number.c | 2 +- lib/tar/src/read_header.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/tar') diff --git a/lib/tar/src/number.c b/lib/tar/src/number.c index 2f179df..2de73ae 100644 --- a/lib/tar/src/number.c +++ b/lib/tar/src/number.c @@ -11,7 +11,7 @@ #include #include -int read_octal(const char *str, int digits, sqfs_u64 *out) +static int read_octal(const char *str, int digits, sqfs_u64 *out) { sqfs_u64 result = 0; diff --git a/lib/tar/src/read_header.c b/lib/tar/src/read_header.c index 219c9fb..1e74841 100644 --- a/lib/tar/src/read_header.c +++ b/lib/tar/src/read_header.c @@ -14,7 +14,7 @@ static bool is_checksum_valid(const tar_header_t *hdr) { sqfs_u64 read_chksum; - if (read_octal(hdr->chksum, sizeof(hdr->chksum), &read_chksum)) + if (read_number(hdr->chksum, sizeof(hdr->chksum), &read_chksum)) return false; return read_chksum == tar_compute_checksum(hdr); @@ -113,7 +113,7 @@ static int decode_header(const tar_header_t *hdr, unsigned int set_by_pax, } } - if (read_octal(hdr->mode, sizeof(hdr->mode), &field)) + if (read_number(hdr->mode, sizeof(hdr->mode), &field)) return -1; out->mode = field & 07777; -- cgit v1.2.3