Marcus Griep schrieb: > +void human_readable_size(char *buf, int buf_size, double size /* in bytes */) > +{ > + char human_readable_prefixes[10] = "BKMGTPEZY"; > + if (buf_size < 5) > + die("insufficient buffer size"); > + int i = 0; > + for (; i < 8 && size >= 1000 ; ++i, size = size / 1024) > + ; > + if (size >= 1000) > + die("size greater than 999Y"); No need to die here. Just make the buffer large enough, and you can have something that is as large as 18446744073709551615Y. -- Hannes -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html