diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-12-29 21:14:51 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-12-29 21:15:47 -0500 |
commit | dbad1685bc2d3bad50c5e161b78d2b8fb9f4d8aa (patch) | |
tree | eb3127084883e6816c5b8e9218c26647634c3af8 /tools-util.c | |
parent | 88242ec7a3acb99a99fe184bbe3c51ab9a620916 (diff) |
show-super can now print more stuff
Diffstat (limited to 'tools-util.c')
-rw-r--r-- | tools-util.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tools-util.c b/tools-util.c index d5450495..04bc6bd2 100644 --- a/tools-util.c +++ b/tools-util.c @@ -112,7 +112,22 @@ struct stat xfstat(int fd) return stat; } -/* Integer stuff: */ +/* Formatting: */ + +int printf_pad(unsigned pad, const char * fmt, ...) +{ + va_list args; + int ret; + + va_start(args, fmt); + ret = vprintf(fmt, args); + va_end(args); + + while (ret++ < pad) + putchar(' '); + + return ret; +} struct units_buf __pr_units(s64 _v, enum units units) { |