--- ./fatresize.c 2015-09-26 22:49:30.258171413 -0700 +++ /tmp/libparted/parted-2.3/libparted/fs/fat/fatresize-1.0.2/fatresize.c 2015-09-26 21:17:00.540337640 -0700 @@ -272,15 +272,17 @@ if (old_geom) { try_snap (&start, start_range, old_geom->start, start_part->geom.start, - start_part->geom.end + 1, -1); + start_part->geom.end + 1, (PedSector) -1); try_snap (&end, end_range, old_geom->end, end_part->geom.end, - end_part->geom.start - 1, -1); + end_part->geom.start - 1, (PedSector) -1); } else { try_snap (&start, start_range, - start_part->geom.start, start_part->geom.end + 1, -1); + start_part->geom.start, + start_part->geom.end + 1, (PedSector) -1); try_snap (&end, end_range, - end_part->geom.end, end_part->geom.start - 1, -1); + end_part->geom.end, + end_part->geom.start - 1, (PedSector) -1); } PED_ASSERT (start <= end, return);