From 703c62da63aa31d665a8215f373b26e4b54f1bf4 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Mon, 18 Oct 1999 21:31:00 +0000 Subject: More stuff --- coreutils/length.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'coreutils') diff --git a/coreutils/length.c b/coreutils/length.c index 284bbfdf9..f2dadd25c 100644 --- a/coreutils/length.c +++ b/coreutils/length.c @@ -3,11 +3,13 @@ #include #include -const char length_usage[] = "length string"; - -int -length_main(struct FileInfo * i, int argc, char * * argv) +extern int +length_main(int argc, char * * argv) { - printf("%d\n", strlen(argv[1])); - return 0; + if ( **(argv+1) == '-' ) { + fprintf(stderr, "Usage: length string\n"); + exit(FALSE); + } + printf("%d\n", strlen(argv[1])); + return( TRUE); } -- cgit v1.2.3