X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=coreutils%2Flength.c;h=55fef131b5c3febe917c633aec0d0867d87c532c;hb=19008b83735341c91fa8a09a072ffe9816c9e423;hp=4cbe7e17b088b2c105dda17a1036d3d8f3c0e2b0;hpb=1d1d95051a288b6bf64498aac9fb20047f384b7d;p=oweals%2Fbusybox.git diff --git a/coreutils/length.c b/coreutils/length.c index 4cbe7e17b..55fef131b 100644 --- a/coreutils/length.c +++ b/coreutils/length.c @@ -1,14 +1,19 @@ /* vi: set sw=4 ts=4: */ -#include "internal.h" + +/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */ + #include #include #include +#include "busybox.h" -extern int length_main(int argc, char **argv) +int length_main(int argc, char **argv) { - if (argc != 2 || **(argv + 1) == '-') { - usage("length string\n"); + if ((argc != 2) || (**(++argv) == '-')) { + bb_show_usage(); } - printf("%lu\n", (long)strlen(argv[1])); - return (TRUE); + + bb_printf("%lu\n", (unsigned long)strlen(*argv)); + + bb_fflush_stdout_and_exit(EXIT_SUCCESS); }