Disk (BSD): fix bytesUsed calculation

Follow up of #508
This commit is contained in:
李通洲 2023-08-01 16:09:20 +08:00
parent 81f7861147
commit 172b3b2968
No known key found for this signature in database
GPG Key ID: 269AD4F5325A22A3
2 changed files with 2 additions and 1 deletions

View File

@ -42,6 +42,7 @@ Bugfixes:
* Properly detect CPU on POWER (CPU, Linux)
* Fix compatibility with Fig (Terminal, macOS)
* Fix option `--title-fqdn` doesn't work (Title)
* Fix used spaces calculation (Disk, Linux / BSD / macOS, #508)
Logo:
* Change the special handling of `kitty` protocol with `.png` image file to a new image protocol `kitty-direct`. This is the fastest image protocol because fastfetch doesn't need to pre-encode the image to base64 or something and the image content doesn't need to be transmitted via tty. Note:

View File

@ -45,7 +45,7 @@ const char* ffDetectDisksImpl(FFlist* disks)
#endif
disk->bytesTotal = fs->f_blocks * fs->f_bsize;
disk->bytesUsed = disk->bytesTotal - ((uint64_t)fs->f_bavail * fs->f_bsize);
disk->bytesUsed = disk->bytesTotal - ((uint64_t)fs->f_bfree * fs->f_bsize);
disk->filesTotal = (uint32_t) fs->f_files;
disk->filesUsed = (uint32_t) (disk->filesTotal - (uint64_t)fs->f_ffree);