blob: 55fef131b5c3febe917c633aec0d0867d87c532c [file] [log] [blame]
Erik Andersene49d5ec2000-02-08 19:58:47 +00001/* vi: set sw=4 ts=4: */
Manuel Novoa III cad53642003-03-19 09:13:01 +00002
3/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */
4
Eric Andersencc8ed391999-10-05 16:24:54 +00005#include <stdlib.h>
6#include <string.h>
7#include <stdio.h>
Eric Andersencbe31da2001-02-20 06:14:08 +00008#include "busybox.h"
Eric Andersencc8ed391999-10-05 16:24:54 +00009
Rob Landleydfba7412006-03-06 20:47:33 +000010int length_main(int argc, char **argv)
Eric Andersencc8ed391999-10-05 16:24:54 +000011{
Manuel Novoa III cad53642003-03-19 09:13:01 +000012 if ((argc != 2) || (**(++argv) == '-')) {
13 bb_show_usage();
14 }
15
16 bb_printf("%lu\n", (unsigned long)strlen(*argv));
17
18 bb_fflush_stdout_and_exit(EXIT_SUCCESS);
Eric Andersencc8ed391999-10-05 16:24:54 +000019}