summaryrefslogtreecommitdiff
path: root/coreutils/length.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-04-10 15:43:37 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-04-10 15:43:37 +0000
commit99912ca733dd960f5589227fd999c86e73c8e894 (patch)
tree9df947fc08884d498cf76a02204d74b121064134 /coreutils/length.c
parentff131b980d524a33d8a43cefe65e14f64a43f2da (diff)
downloadbusybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.tar.gz
busybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.tar.bz2
busybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.zip
audit small applets and mark some of them as NOFORK.
Put big scary warnings in relevant places.
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}