diff options
Diffstat (limited to 'length.c')
-rw-r--r-- | length.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -3,11 +3,13 @@ #include <string.h> #include <stdio.h> -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); } |