diff options
author | Matt Kraai <kraai@debian.org> | 2000-07-14 23:28:47 +0000 |
---|---|---|
committer | Matt Kraai <kraai@debian.org> | 2000-07-14 23:28:47 +0000 |
commit | 3bd8bd89ee9d0b65bf279e1ecad826a5f2f0a217 (patch) | |
tree | 6a217bf17e7c00e98a47f657015535f21b53cedd /length.c | |
parent | 464c5de00d3dfb5f01e866f703d95bbb2bb9443c (diff) | |
download | busybox-w32-3bd8bd89ee9d0b65bf279e1ecad826a5f2f0a217.tar.gz busybox-w32-3bd8bd89ee9d0b65bf279e1ecad826a5f2f0a217.tar.bz2 busybox-w32-3bd8bd89ee9d0b65bf279e1ecad826a5f2f0a217.zip |
Don't use strings directly in calls to usage(). This is in preparation
for their extraction to a separate file.
Diffstat (limited to 'length.c')
-rw-r--r-- | length.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -4,15 +4,17 @@ | |||
4 | #include <string.h> | 4 | #include <string.h> |
5 | #include <stdio.h> | 5 | #include <stdio.h> |
6 | 6 | ||
7 | extern int length_main(int argc, char **argv) | 7 | const char length_usage[] = |
8 | { | 8 | "length STRING\n" |
9 | if (argc != 2 || **(argv + 1) == '-') { | ||
10 | usage("length STRING\n" | ||
11 | #ifndef BB_FEATURE_TRIVIAL_HELP | 9 | #ifndef BB_FEATURE_TRIVIAL_HELP |
12 | "\nPrints out the length of the specified STRING.\n" | 10 | "\nPrints out the length of the specified STRING.\n" |
13 | #endif | 11 | #endif |
14 | ); | 12 | ; |
15 | } | 13 | |
14 | extern int length_main(int argc, char **argv) | ||
15 | { | ||
16 | if (argc != 2 || **(argv + 1) == '-') | ||
17 | usage(length_usage); | ||
16 | printf("%lu\n", (long)strlen(argv[1])); | 18 | printf("%lu\n", (long)strlen(argv[1])); |
17 | return (TRUE); | 19 | return (TRUE); |
18 | } | 20 | } |