revert to use units for 1024 bytes instead for 1000 bytes

This commit is contained in:
Night Kaly 2024-03-17 22:19:19 +00:00
parent 0ed3ca858e
commit 82ccba51cb
No known key found for this signature in database
GPG key ID: 8E829D3381CFEBBE

2
ccc.c
View file

@ -495,7 +495,7 @@ long add_file_stat(char *filepath, int ftype)
/* max 25 chars due to long, space, suffix and null */ /* max 25 chars due to long, space, suffix and null */
char *size = memalloc(25 * sizeof(char)); char *size = memalloc(25 * sizeof(char));
int unit = 0; int unit = 0;
const char* units[] = {"B", "KB", "MB", "GB", "TB", "PB"}; const char* units[] = {"B", "KiB", "MiB", "GiB", "TiB", "PiB"};
while (bytes > 1024) { while (bytes > 1024) {
bytes /= 1024; bytes /= 1024;
unit++; unit++;