mkswap: cast before lseek [lgtm scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2019-09-20 15:47:55 +02:00
parent c135625734
commit a6a24f18e6
1 changed files with 2 additions and 2 deletions

View File

@ -191,9 +191,9 @@ static void check_blocks(struct mkswap_control *ctl)
buffer = xmalloc(ctl->pagesize);
while (current_page < ctl->npages) {
ssize_t rc;
off_t offset = (off_t) current_page * ctl->pagesize;
if (do_seek && lseek(ctl->fd, current_page * ctl->pagesize, SEEK_SET) !=
current_page * ctl->pagesize)
if (do_seek && lseek(ctl->fd, offset, SEEK_SET) != offset)
errx(EXIT_FAILURE, _("seek failed in check_blocks"));
rc = read(ctl->fd, buffer, ctl->pagesize);