Skip to content

Commit

Permalink
duplicate memory unit removed
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdotx committed Nov 4, 2022
1 parent f3ce0d6 commit 47f33f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* path: /home/klassiker/.local/share/repos/cinfo/cinfo.c
* author: klassiker [mrdotx]
* github: https://github.com/mrdotx/cinfo
* date: 2022-10-11T12:34:44+0200
* date: 2022-11-04T08:52:12+0100
*/

#include <stddef.h>
Expand Down Expand Up @@ -347,7 +347,7 @@ void *get_mem() {
if (0 == strcmp(MEMORY_UNIT, "MiB") \
|| (0 == strcmp(MEMORY_UNIT, "auto") && 1024 > mem_total)) {
if (0 < swap_total) {
sprintf(g_mem, "%dMiB%s%dMiB [%.1f%%]%s%dMiB%s%dMiB [%.1f%%]", \
sprintf(g_mem, "%d%s%d MiB [%.1f%%]%s%d%s%d MiB [%.1f%%]", \
mem_available, \
MEMORY_DIVIDER, \
mem_total, \
Expand All @@ -358,7 +358,7 @@ void *get_mem() {
swap_total, \
swap_percent);
} else {
sprintf(g_mem, "%dMiB%s%dMiB [%.1f%%]", \
sprintf(g_mem, "%d%s%d MiB [%.1f%%]", \
mem_available, \
MEMORY_DIVIDER, \
mem_total, \
Expand All @@ -369,7 +369,7 @@ void *get_mem() {
if (0 == strcmp(MEMORY_UNIT, "GiB") \
|| (0 == strcmp(MEMORY_UNIT, "auto") && 1024 <= mem_total)) {
if (0 < swap_total) {
sprintf(g_mem, "%.2fGiB%s%.2fGiB [%.1f%%]%s%.2fGiB%s%.2fGiB [%.1f%%]", \
sprintf(g_mem, "%.2f%s%.2f GiB [%.1f%%]%s%.2f%s%.2f GiB [%.1f%%]", \
(float)mem_available / 1024, \
MEMORY_DIVIDER, \
(float)mem_total / 1024, \
Expand All @@ -380,7 +380,7 @@ void *get_mem() {
(float)swap_total / 1024, \
swap_percent);
} else {
sprintf(g_mem, "%.2fGiB%s%.2fGiB [%.1f%%]", \
sprintf(g_mem, "%.2f%s%.2f GiB [%.1f%%]", \
(float)mem_available / 1024, \
MEMORY_DIVIDER, \
(float)mem_total / 1024, \
Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 47f33f2

Please sign in to comment.