blob: 6413be007f95c30d63c4902a617a2951ddd0f1ef [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
Denis Vlasenko2fe7b732006-10-26 23:39:04 +000016 printf("%lu\n", (unsigned long)strlen(*argv));
Manuel Novoa III cad53642003-03-19 09:13:01 +000017
Denis Vlasenko2fe7b732006-10-26 23:39:04 +000018 fflush_stdout_and_exit(EXIT_SUCCESS);
Eric Andersencc8ed391999-10-05 16:24:54 +000019}