diff options
author | Stef <stef@memberwebs.com> | 2010-11-27 04:15:42 +0000 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2010-12-01 03:56:37 +0000 |
commit | 2ebc84e7954b02c71d04ddc581eb11766bac11f2 (patch) | |
tree | 80b633d851adbdd07a522adfd8755bbf42c27328 | |
parent | 8dc7f827a869256bc6b5755b165e89935678ba6d (diff) |
Use 64-bit integers when listing partition info.
-rw-r--r-- | src/list.c | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -28,8 +28,6 @@ const char kPrintData[] = "\ const char kPrintDrive[] = "\nDrive: %u\n"; const char kPrintDrivePath[] = "\nDrive: %s\n"; -const char kPrintDriveInfo[] = " %-15u %-15u "; -const char kPrintNTFSInfo[] = "%-15u %-15u"; int printNTFSInfo(int dd, uint64 tblSector) { @@ -53,7 +51,15 @@ int printNTFSInfo(int dd, uint64 tblSector) boot = (ntfs_bootsector*)sector; if(!memcmp(boot->sysId, kNTFS_SysId, sizeof(boot->sysId))) - printf(kPrintNTFSInfo, boot->secPerClus, boot->offMFT * boot->secPerClus); + { +#ifdef _WIN32 + printf("%-15u %-15I64u", (unsigned int)boot->secPerClus, + boot->offMFT * (uint64)boot->secPerClus); +#else + printf("%-15u %-15llu", (unsigned int)boot->secPerClus, + (unsigned long long)(boot->offMFT * (uint64)boot->secPerClus)); +#endif + } printf("\n"); return 0; @@ -91,7 +97,16 @@ int printPartitionInfo(int dd, uint64 tblSector) } else if(!mbr.partitions[i].system == kPartition_Invalid) { - printf(kPrintDriveInfo, (uint32)tblSector + mbr.partitions[i].startsec, (uint32)tblSector + mbr.partitions[i].endsec); +#ifdef _WIN32 + printf(" %-15I64u %-15I64u ", + tblSector + mbr.partitions[i].startsec, + tblSector + mbr.partitions[i].endsec); +#else + printf(" %-15llu %-15llu ", + (unsigned long long)(tblSector + mbr.partitions[i].startsec), + (unsigned long long)tblSector + mbr.partitions[i].endsec)); +#endif + printNTFSInfo(dd, tblSector + (uint64)mbr.partitions[i].startsec); } } |