]> git.eshelyaron.com Git - emacs.git/commitdiff
int → ptrdiff_t for read results
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 13 Jul 2025 16:35:38 +0000 (09:35 -0700)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 08:49:02 +0000 (10:49 +0200)
* src/fileio.c (Finsert_file_contents): Use ptrdiff_t, not int, to
store results returned by emacs_fd_read, which return ptrdiff_t.
This doesn’t fix any bugs since the values happen to fit in int,
but is a bit clearer and may simplify future changes.

(cherry picked from commit 8ac78986ff7028c249f136b3523dacf0693c22d3)

src/fileio.c

index bd8528af235c694c0291859f423f49803c3dc053..8150f4d8e12e84a16f76e03126e8ecc80b1936cb 100644 (file)
@@ -4501,7 +4501,7 @@ by calling `format-decode', which see.  */)
 
       while (!giveup_match_end)
        {
-         int total_read, nread, bufpos, trial;
+         ptrdiff_t total_read, nread, bufpos, trial;
          off_t curpos;
 
          /* At what file position are we now scanning?  */