chiark / gitweb /
capability: use /proc/sys/kernel/cap_last_cap
[elogind.git] / src / shared / util.c
index 92b4d498fee5874d4b2dc36d38deb7da49679715..dfaf7f7f45b07416bcd365b869c7b05b4618d752 100644 (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) {