forked from external/yambar
tag: fix inverted logic for KiB vs KB logic
This commit is contained in:
parent
1cf14a7f80
commit
52e0b5f3d1
2 changed files with 7 additions and 6 deletions
|
@ -50,6 +50,7 @@
|
|||
allowed, leading to various bad things; including yambar crashing,
|
||||
or worse, the compositor crashing
|
||||
(https://codeberg.org/dnkl/yambar/issues/129).
|
||||
* kib/kb, mib/mb and gib/gb formatters were inverted.
|
||||
|
||||
|
||||
### Security
|
||||
|
|
12
tag.c
12
tag.c
|
@ -545,12 +545,12 @@ tags_expand_template(const char *template, const struct tag_set *tags)
|
|||
case FMT_MIBYTE:
|
||||
case FMT_GIBYTE: {
|
||||
const long divider =
|
||||
format == FMT_KBYTE ? 1024 :
|
||||
format == FMT_MBYTE ? 1024 * 1024 :
|
||||
format == FMT_GBYTE ? 1024 * 1024 * 1024 :
|
||||
format == FMT_KIBYTE ? 1000 :
|
||||
format == FMT_MIBYTE ? 1000 * 1000 :
|
||||
format == FMT_GIBYTE ? 1000 * 1000 * 1000 :
|
||||
format == FMT_KBYTE ? 1000 :
|
||||
format == FMT_MBYTE ? 1000 * 1000 :
|
||||
format == FMT_GBYTE ? 1000 * 1000 * 1000 :
|
||||
format == FMT_KIBYTE ? 1024 :
|
||||
format == FMT_MIBYTE ? 1024 * 1024 :
|
||||
format == FMT_GIBYTE ? 1024 * 1024 * 1024 :
|
||||
1;
|
||||
|
||||
char str[24];
|
||||
|
|
Loading…
Add table
Reference in a new issue