Changeset 1770 in MondoRescue for branches/stable/mindi-busybox/coreutils/length.c
- Timestamp:
- Nov 6, 2007, 11:01:53 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi-busybox/coreutils/length.c
r821 r1770 3 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 "libbb.h" 9 6 7 /* This is a NOFORK applet. Be very careful! */ 8 9 int length_main(int argc, char **argv); 10 10 int length_main(int argc, char **argv) 11 11 { 12 if ((argc != 2) || 13 12 if ((argc != 2) || (**(++argv) == '-')) { 13 bb_show_usage(); 14 14 } 15 15 16 bb_printf("%lu\n", (unsigned long)strlen(*argv));16 printf("%u\n", (unsigned)strlen(*argv)); 17 17 18 bb_fflush_stdout_and_exit(EXIT_SUCCESS);18 return fflush(stdout); 19 19 }
Note:
See TracChangeset
for help on using the changeset viewer.