projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6b1849
)
util: treat -1 as special size in format_bytes()
author
Lennart Poettering
<lennart@poettering.net>
Sun, 28 Dec 2014 01:07:32 +0000
(
02:07
+0100)
committer
Lennart Poettering
<lennart@poettering.net>
Sun, 28 Dec 2014 01:08:40 +0000
(
02:08
+0100)
src/shared/util.c
patch
|
blob
|
history
diff --git
a/src/shared/util.c
b/src/shared/util.c
index
92b4d49
..
dfaf7f7
100644
(file)
--- a/
src/shared/util.c
+++ b/
src/shared/util.c
@@
-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) {