When things get bigger than 99GB our fields run over.

Use GB from 100GB and upwards.

Approved by:	re
This commit is contained in:
Poul-Henning Kamp 2002-12-11 17:36:34 +00:00
parent f0fab6045d
commit b6cf3e46b4
2 changed files with 40 additions and 10 deletions

View File

@ -611,10 +611,18 @@ print_label_chunks(void)
if (i == pslice_focus)
pslice_focus_found = -1;
mvprintw(srow++, 0,
"Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name,
sz, (sz / ONE_MEG));
if (sz >= 100 * ONE_GIG)
mvprintw(srow++, 0,
"Disk: %s\tPartition name: %s\tFree: %d blocks (%dGB)",
label_chunk_info[i].c->disk->name,
label_chunk_info[i].c->name,
sz, (sz / ONE_GIG));
else
mvprintw(srow++, 0,
"Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].c->disk->name,
label_chunk_info[i].c->name,
sz, (sz / ONE_MEG));
attrset(A_NORMAL);
clrtoeol();
move(0, 0);
@ -703,7 +711,14 @@ print_label_chunks(void)
strcpy(newfs, "*");
for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++)
onestr[PART_MOUNT_COL + j] = mountpoint[j];
snprintf(num, 10, "%5ldMB", label_chunk_info[i].c->size ? label_chunk_info[i].c->size / ONE_MEG : 0);
if (label_chunk_info[i].c->size == 0)
snprintf(num, 10, "%5ldMB", 0);
else if (label_chunk_info[i].c->size < (100 * ONE_GIG))
snprintf(num, 10, "%5ldMB",
label_chunk_info[i].c->size / ONE_MEG);
else
snprintf(num, 10, "%5ldGB",
label_chunk_info[i].c->size / ONE_GIG);
memcpy(onestr + PART_SIZE_COL, num, strlen(num));
memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs));
onestr[PART_NEWFS_COL + strlen(newfs)] = '\0';

View File

@ -611,10 +611,18 @@ print_label_chunks(void)
if (i == pslice_focus)
pslice_focus_found = -1;
mvprintw(srow++, 0,
"Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name,
sz, (sz / ONE_MEG));
if (sz >= 100 * ONE_GIG)
mvprintw(srow++, 0,
"Disk: %s\tPartition name: %s\tFree: %d blocks (%dGB)",
label_chunk_info[i].c->disk->name,
label_chunk_info[i].c->name,
sz, (sz / ONE_GIG));
else
mvprintw(srow++, 0,
"Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].c->disk->name,
label_chunk_info[i].c->name,
sz, (sz / ONE_MEG));
attrset(A_NORMAL);
clrtoeol();
move(0, 0);
@ -703,7 +711,14 @@ print_label_chunks(void)
strcpy(newfs, "*");
for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++)
onestr[PART_MOUNT_COL + j] = mountpoint[j];
snprintf(num, 10, "%5ldMB", label_chunk_info[i].c->size ? label_chunk_info[i].c->size / ONE_MEG : 0);
if (label_chunk_info[i].c->size == 0)
snprintf(num, 10, "%5ldMB", 0);
else if (label_chunk_info[i].c->size < (100 * ONE_GIG))
snprintf(num, 10, "%5ldMB",
label_chunk_info[i].c->size / ONE_MEG);
else
snprintf(num, 10, "%5ldGB",
label_chunk_info[i].c->size / ONE_GIG);
memcpy(onestr + PART_SIZE_COL, num, strlen(num));
memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs));
onestr[PART_NEWFS_COL + strlen(newfs)] = '\0';