From 8c7de243f4f6425bf121e2eacaa9af3630eb2f5c Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Fri, 18 May 2018 17:43:15 +0000 Subject: [PATCH] Fix math error in the computation of the free space after the last partition on a disk. This resulted in one sector always remaining free at the end. PR: bin/228322 Submitted by: Rikiya Yonemoto MFC after: 2 weeks --- usr.sbin/bsdinstall/partedit/gpart_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c b/usr.sbin/bsdinstall/partedit/gpart_ops.c index b2cfef597fd6..d6a2c44c4dd4 100644 --- a/usr.sbin/bsdinstall/partedit/gpart_ops.c +++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c @@ -856,7 +856,7 @@ gpart_max_free(struct ggeom *geom, intmax_t *npartstart) } if (end - lastend > maxsize) { - maxsize = end - lastend - 1; + maxsize = end - lastend; maxstart = lastend + 1; }