diff --git a/usr.bin/mkimg/bsd.c b/usr.bin/mkimg/bsd.c index a93ed0dc5461..03af5cd2e863 100644 --- a/usr.bin/mkimg/bsd.c +++ b/usr.bin/mkimg/bsd.c @@ -80,7 +80,7 @@ bsd_write(lba_t imgsz, void *bootcode) } else memset(buf, 0, BBSIZE); - imgsz = ncyls * nheads * nsecs; + imgsz = (lba_t)ncyls * nheads * nsecs; error = image_set_size(imgsz); if (error) { free(buf); diff --git a/usr.bin/mkimg/vtoc8.c b/usr.bin/mkimg/vtoc8.c index 05a3ce8ac2bc..8eb7d24080bd 100644 --- a/usr.bin/mkimg/vtoc8.c +++ b/usr.bin/mkimg/vtoc8.c @@ -71,7 +71,7 @@ vtoc8_write(lba_t imgsz, void *bootcode __unused) int error, n; uint16_t ofs, sum; - imgsz = ncyls * nheads * nsecs; + imgsz = (lba_t)ncyls * nheads * nsecs; memset(&vtoc8, 0, sizeof(vtoc8)); sprintf(vtoc8.ascii, "FreeBSD%lldM",