Commit 825fc895 authored by Milan Broz's avatar Milan Broz

Fix some signed/unsigned comparison warnings.

parent a74aeced
......@@ -250,7 +250,7 @@ int LUKS_decrypt_from_storage(char *dst, size_t dstLength,
if (read_lseek_blockwise(devfd, device_block_size(device),
device_alignment(device), dst, dstLength,
sector * SECTOR_SIZE) < 0) {
if (!fstat(devfd, &st) && (st.st_size < dstLength))
if (!fstat(devfd, &st) && (st.st_size < (off_t)dstLength))
log_err(ctx, _("Device %s is too small."), device_path(device));
else
log_err(ctx, _("IO error while decrypting keyslot."));
......
......@@ -184,7 +184,7 @@ ssize_t read_blockwise(int fd, size_t bsize, size_t alignment,
out:
free(hangover_buf);
if (buf != orig_buf) {
if (ret == length)
if (ret != -1)
memcpy(orig_buf, buf, length);
free(buf);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment