diff --git a/EncryptInplace.cpp b/EncryptInplace.cpp index c0a0ba0..87c59a5 100644 --- a/EncryptInplace.cpp +++ b/EncryptInplace.cpp @@ -344,7 +344,7 @@ static int cryptfs_enable_inplace_ext4(const char* crypto_blkdev, const char* re errout: close(data.realfd); - if (!strncmp(real_blkdev, crypto_blkdev, strlen(real_blkdev))) + if (strncmp(real_blkdev, crypto_blkdev, strlen(real_blkdev))) close(data.cryptofd); return rc; @@ -479,7 +479,7 @@ errout: free(f2fs_info); free(data.buffer); close(data.realfd); - if (!strncmp(real_blkdev, crypto_blkdev, strlen(real_blkdev))) + if (strncmp(real_blkdev, crypto_blkdev, strlen(real_blkdev))) close(data.cryptofd); return rc; @@ -532,7 +532,7 @@ static int cryptfs_enable_inplace_full(const char* crypto_blkdev, const char* re goto errout; } - if (!strncmp(real_blkdev, crypto_blkdev, strlen(real_blkdev))) { + if (strncmp(real_blkdev, crypto_blkdev, strlen(real_blkdev))) { if (lseek64(cryptofd, i * CRYPT_SECTOR_SIZE, SEEK_SET) < 0) { PLOG(ERROR) << "Cannot seek to previously encrypted point on " << crypto_blkdev; goto errout; @@ -600,7 +600,7 @@ static int cryptfs_enable_inplace_full(const char* crypto_blkdev, const char* re errout: close(realfd); - if (!strncmp(real_blkdev, crypto_blkdev, strlen(real_blkdev))) + if (strncmp(real_blkdev, crypto_blkdev, strlen(real_blkdev))) close(cryptofd); return rc;