aboutsummaryrefslogtreecommitdiff
path: root/src/xz/file_io.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-08-31 18:14:43 +0300
committerLasse Collin <lasse.collin@tukaani.org>2023-08-31 18:14:43 +0300
commitf7093cd9d130477c234b40aeda613964171f8f21 (patch)
tree8b53439f7bf7f1fda7605d402720008ad57392e1 /src/xz/file_io.c
parentTests: Improve invalid unpadded size check in test_lzma_index_append(). (diff)
downloadxz-f7093cd9d130477c234b40aeda613964171f8f21.tar.xz
xz: Fix a too relaxed assertion and remove uses of SSIZE_MAX.
SSIZE_MAX isn't readily available on MSVC. Removing it means that there is one thing less to worry when porting to MSVC.
Diffstat (limited to '')
-rw-r--r--src/xz/file_io.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/xz/file_io.c b/src/xz/file_io.c
index a181b531..767c819a 100644
--- a/src/xz/file_io.c
+++ b/src/xz/file_io.c
@@ -1157,8 +1157,7 @@ io_fix_src_pos(file_pair *pair, size_t rewind_size)
extern size_t
io_read(file_pair *pair, io_buf *buf, size_t size)
{
- // We use small buffers here.
- assert(size < SSIZE_MAX);
+ assert(size <= IO_BUFFER_SIZE);
size_t pos = 0;
@@ -1285,7 +1284,7 @@ is_sparse(const io_buf *buf)
static bool
io_write_buf(file_pair *pair, const uint8_t *buf, size_t size)
{
- assert(size < SSIZE_MAX);
+ assert(size <= IO_BUFFER_SIZE);
while (size > 0) {
const ssize_t amount = write(pair->dest_fd, buf, size);