git: d830cac9fed1 - main - recoverdisk: Fix comparison between stripesize and sectorsize

From: Poul-Henning Kamp <phk_at_FreeBSD.org>
Date: Sun, 05 Jan 2025 20:16:37 UTC
The branch main has been updated by phk:

URL: https://cgit.FreeBSD.org/src/commit/?id=d830cac9fed1882a192b0ec5c96fb3ac9bfbc2ee

commit d830cac9fed1882a192b0ec5c96fb3ac9bfbc2ee
Author:     Poul-Henning Kamp <phk@FreeBSD.org>
AuthorDate: 2025-01-05 20:14:37 +0000
Commit:     Poul-Henning Kamp <phk@FreeBSD.org>
CommitDate: 2025-01-05 20:16:22 +0000

    recoverdisk: Fix comparison between stripesize and sectorsize
    
    Discovered trying to read a 360KB floppy disk :-)
---
 sbin/recoverdisk/recoverdisk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/recoverdisk/recoverdisk.c b/sbin/recoverdisk/recoverdisk.c
index 91f42c904c52..446266c36d50 100644
--- a/sbin/recoverdisk/recoverdisk.c
+++ b/sbin/recoverdisk/recoverdisk.c
@@ -482,7 +482,7 @@ main(int argc, char * const argv[])
 			err(1, "DIOCGSECTORSIZE failed");
 
 		error = ioctl(fdr, DIOCGSTRIPESIZE, &stripesize);
-		if (error == 0 && stripesize > sectorsize)
+		if (error == 0 && stripesize < sectorsize)
 			sectorsize = stripesize;
 
 		minsize = sectorsize;