mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 11:50:10 +01:00
Fix some signed/unsigned comparison warnings.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user