From f84e1e7a1c6e47c596ec11fb78532f6ec023caaf Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Mon, 13 Jan 2003 17:17:52 +0000 Subject: [PATCH] fix by Szaka (logic inversion in ntfs_device_size_get()) (Logical change 1.92) --- libntfs/disk_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libntfs/disk_io.c b/libntfs/disk_io.c index 63cd7933..8170475c 100644 --- a/libntfs/disk_io.c +++ b/libntfs/disk_io.c @@ -398,12 +398,12 @@ s64 ntfs_device_size_get(int f, int block_size) * so do binary search to find the size of the device. */ low = 0LL; - for (high = 1024LL; ntfs_device_offset_valid(f, high); high <<= 1) + for (high = 1024LL; !ntfs_device_offset_valid(f, high); high <<= 1) low = high; while (low < high - 1LL) { const s64 mid = (low + high) / 2; - if (ntfs_device_offset_valid(f, mid)) + if (!ntfs_device_offset_valid(f, mid)) low = mid; else high = mid;