From 99912ca733dd960f5589227fd999c86e73c8e894 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 10 Apr 2007 15:43:37 +0000 Subject: audit small applets and mark some of them as NOFORK. Put big scary warnings in relevant places. --- coreutils/length.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'coreutils/length.c') 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 @@ /* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */ -#include -#include -#include #include "busybox.h" +/* This is a NOFORK applet. Be very careful! */ + int length_main(int argc, char **argv); int length_main(int argc, char **argv) { - if ((argc != 2) || (**(++argv) == '-')) { - bb_show_usage(); + if ((argc != 2) || (**(++argv) == '-')) { + bb_show_usage(); } - printf("%lu\n", (unsigned long)strlen(*argv)); + printf("%u\n", (unsigned)strlen(*argv)); - fflush_stdout_and_exit(EXIT_SUCCESS); + return fflush(stdout); } -- cgit v1.2.3