diff options
-rwxr-xr-x | Android.bp | 17 | ||||
-rw-r--r-- | mkfs_msdos.c | 8 |
2 files changed, 21 insertions, 4 deletions
@@ -1,3 +1,20 @@ +package { + default_applicable_licenses: ["external_newfs_msdos_license"], +} + +// Added automatically by a large-scale-change +// See: http://go/android-license-faq +license { + name: "external_newfs_msdos_license", + visibility: [":__subpackages__"], + license_kinds: [ + "SPDX-license-identifier-BSD", + ], + license_text: [ + "LICENSE", + ], +} + cc_binary { name: "newfs_msdos", c_std: "gnu11", diff --git a/mkfs_msdos.c b/mkfs_msdos.c index 08c435b..946096f 100644 --- a/mkfs_msdos.c +++ b/mkfs_msdos.c @@ -936,14 +936,14 @@ static int getdiskinfo(int fd, const char *fname, const char *dtype, if (ckgeom(fname, bpb->bpbBytesPerSec, "bytes/sector") == -1) return -1; - u_long device_size; + u_int64_t device_size; if (ioctl(fd, BLKGETSIZE64, &device_size)) { err(1, "ioctl(BLKGETSIZE64) failed"); } - u_long sectors = device_size/bpb->bpbBytesPerSec; - if (sectors > UINT32_MAX) { - errx(1, "too many sectors: %lu (%lu byte device, %u bytes/sector)", + u_int64_t sectors = device_size/bpb->bpbBytesPerSec; + if (sectors > UINT_MAX) { + errx(1, "too many sectors: %"PRIu64" (%"PRIu64" byte device, %u bytes/sector)", sectors, device_size, bpb->bpbBytesPerSec); } bpb->bpbHugeSectors = sectors; |