aboutsummaryrefslogtreecommitdiff
path: root/coreutils/length.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/length.c')
-rw-r--r--coreutils/length.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/coreutils/length.c b/coreutils/length.c
index 1dc122cc1..b3a9d4903 100644
--- a/coreutils/length.c
+++ b/coreutils/length.c
@@ -2,19 +2,18 @@
2 2
3/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */ 3/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */
4 4
5#include <stdlib.h>
6#include <string.h>
7#include <stdio.h>
8#include "busybox.h" 5#include "busybox.h"
9 6
7/* This is a NOFORK applet. Be very careful! */
8
10int length_main(int argc, char **argv); 9int length_main(int argc, char **argv);
11int length_main(int argc, char **argv) 10int length_main(int argc, char **argv)
12{ 11{
13 if ((argc != 2) || (**(++argv) == '-')) { 12 if ((argc != 2) || (**(++argv) == '-')) {
14 bb_show_usage(); 13 bb_show_usage();
15 } 14 }
16 15
17 printf("%lu\n", (unsigned long)strlen(*argv)); 16 printf("%u\n", (unsigned)strlen(*argv));
18 17
19 fflush_stdout_and_exit(EXIT_SUCCESS); 18 return fflush(stdout);
20} 19}