1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-12 09:17:44 +03:00

util: treat -1 as special size in format_bytes()

This commit is contained in:
Lennart Poettering 2014-12-28 02:07:32 +01:00
parent b6b1849830
commit f02ca52281

View File

@ -5184,6 +5184,9 @@ char *format_bytes(char *buf, size_t l, off_t t) {
{ "K", 1024ULL },
};
if (t == (off_t) -1)
return NULL;
for (i = 0; i < ELEMENTSOF(table); i++) {
if (t >= table[i].factor) {