diff options
Diffstat (limited to 'bin/ls/print.c')
-rw-r--r-- | bin/ls/print.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/bin/ls/print.c b/bin/ls/print.c index 3f2033c..a788042 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include <langinfo.h> #include <libutil.h> #include <stdio.h> +#include <stdint.h> #include <stdlib.h> #include <string.h> #include <time.h> @@ -351,16 +352,8 @@ printaname(const FTSENT *p, u_long inodefield, u_long sizefield) static void printdev(size_t width, dev_t dev) { - char buf[DEVSTR_HEX_LEN + 1]; - if (minor(dev) > 255 || minor(dev) < 0) - (void)snprintf(buf, sizeof(buf), "%3d, 0x%08x", - major(dev), (u_int)minor(dev)); - else - (void)snprintf(buf, sizeof(buf), "%3d, %3d", - major(dev), minor(dev)); - - (void)printf("%*s ", (u_int)width, buf); + (void)printf("%#*jx ", (u_int)width, (uintmax_t)dev); } static void |