* src/copy-file-data.c (lseek_copy): hole_start is initialized
only when ext_start == ipos.
(infer_scantype): Update the hole_start initialization to
the more logically correct POS, even though that init
is only needed to suppress a -Wmaybe-uninitialized warning.
Note gcc 15.2 at least doesn't seem to need that suppression.
for (off_t ext_start = scan_inference->ext_start;
0 <= ext_start && ext_start < max_ipos; )
{
- off_t ext_end = (ext_start == 0
+ off_t ext_end = (ext_start == ipos
? scan_inference->hole_start
: lseek (src_fd, ext_start, SEEK_HOLE));
if (0 <= ext_end)
}
else if (pos < scan_inference->ext_start || errno == ENXIO)
{
- scan_inference->hole_start = 0; /* Pacify -Wmaybe-uninitialized. */
+ scan_inference->hole_start = pos; /* Pacify -Wmaybe-uninitialized. */
return LSEEK_SCANTYPE;
}
else if (errno != EINVAL && !is_ENOTSUP (errno))