summaryrefslogtreecommitdiff
path: root/coreutils/length.c
blob: 2c83cdfd2d44d40125cf6931a5ec421895c01adb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "internal.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

extern int
length_main(int argc, char * * argv)
{
    if ( argc != 2 || **(argv+1) == '-' ) {
	usage("length string\n");
    }
    printf("%d\n", strlen(argv[1]));
    return( TRUE);
}