On Sat, Feb 23, 2019 at 12:09:54PM +0800, 冰柯 wrote: > } else { > /* primary partitions */ > if (fdisk_use_cylinders(cxt) || !cxt->total_sectors) > limit = cxt->geom.heads * cxt->geom.sectors * cxt->geom.cylinders - 1; > else > limit = cxt->total_sectors - 1; /* HERE */ > > if (limit > UINT_MAX) > limit = UINT_MAX; > } Fixed. Now the code follows situation on the device rather than total sectors and first LBA. Thanks for your report! Karel Icy. -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com