diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-04 20:26:14 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-06-05 09:16:39 +0200 |
commit | 1370963723917eed6c93e28c9970a2b27be57ea4 (patch) | |
tree | 14c6e45fc1a4ccd1721823d65edd8a892135e23d /bin | |
parent | 8af4ee6f415fe316894e4423235dfc4ee70d8cbb (diff) |
libio: remove buffer_offset from istream_t
Instead, make the buffer const, let the user adjust the pointer and
size. The offset can then be inferred in precache.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/tar2sqfs/src/tar2sqfs.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/bin/tar2sqfs/src/tar2sqfs.c b/bin/tar2sqfs/src/tar2sqfs.c index 9257fed..1145675 100644 --- a/bin/tar2sqfs/src/tar2sqfs.c +++ b/bin/tar2sqfs/src/tar2sqfs.c @@ -36,22 +36,17 @@ static istream_t *magic_autowrap(istream_t *strm) { xfrm_stream_t *xfrm = NULL; istream_t *wrapper = NULL; - const sqfs_u8 *data; - size_t avail; int ret; ret = istream_precache(strm); if (ret != 0) goto out; - data = strm->buffer + strm->buffer_offset; - avail = strm->buffer_used - strm->buffer_offset; - - ret = tar_probe(data, avail); + ret = tar_probe(strm->buffer, strm->buffer_used); if (ret > 0) return strm; - ret = xfrm_compressor_id_from_magic(data, avail); + ret = xfrm_compressor_id_from_magic(strm->buffer, strm->buffer_used); if (ret <= 0) return strm; |