From 39d315e8eaefacd39103a0d17dd4f7bc83af70e3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 1 Aug 2024 07:16:49 -0700 Subject: [PATCH] ptrdiff_t, not int * src/delete.c (delete_archive_members): Use ptrdiff_t, not int, to count memory blocks. (write_recent_bytes): Simplify remainder calculation. --- src/delete.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/delete.c b/src/delete.c index cd32ec97..4223f95c 100644 --- a/src/delete.c +++ b/src/delete.c @@ -116,7 +116,7 @@ static void write_recent_bytes (char *data, size_t bytes) { size_t blocks = bytes / BLOCKSIZE; - size_t rest = bytes - blocks * BLOCKSIZE; + size_t rest = bytes % BLOCKSIZE; write_recent_blocks ((union block *)data, blocks); memcpy (new_record[new_blocks].buffer, data + blocks * BLOCKSIZE, rest); @@ -154,7 +154,7 @@ delete_archive_members (void) /* FIXME: Should clean the routine before cleaning these variables :-( */ struct name *name; off_t blocks_to_keep = 0; - int kept_blocks_in_record; + ptrdiff_t kept_blocks_in_record; name_gather (); open_archive (ACCESS_UPDATE); @@ -307,7 +307,7 @@ delete_archive_members (void) while (blocks_to_keep) { - int count; + ptrdiff_t count; if (current_block == record_end) { -- 2.47.3