diff options
Diffstat (limited to 'usr.bin/cut/cut.c')
-rw-r--r-- | usr.bin/cut/cut.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c index d84b46e..c90333e 100644 --- a/usr.bin/cut/cut.c +++ b/usr.bin/cut/cut.c @@ -32,19 +32,6 @@ * SUCH DAMAGE. */ -#include <sys/cdefs.h> -#ifndef lint -__COPYRIGHT("@(#) Copyright (c) 1989, 1993\ - The Regents of the University of California. All rights reserved."); -#endif /* not lint */ - -#ifndef lint -#if 0 -static char sccsid[] = "@(#)cut.c 8.3 (Berkeley) 5/4/95"; -#endif -__RCSID("$NetBSD: cut.c,v 1.29 2014/02/03 20:22:19 wiz Exp $"); -#endif /* not lint */ - #include <ctype.h> #include <err.h> #include <errno.h> @@ -52,9 +39,9 @@ __RCSID("$NetBSD: cut.c,v 1.29 2014/02/03 20:22:19 wiz Exp $"); #include <locale.h> #include <stdio.h> #include <stdlib.h> +#include <bsd/stdlib.h> #include <string.h> #include <unistd.h> -#include <util.h> #include <wchar.h> #include <sys/param.h> @@ -69,7 +56,7 @@ static void b_cut(FILE *, const char *); static void c_cut(FILE *, const char *); static void f_cut(FILE *, const char *); static void get_list(char *); -static void usage(void) __dead; +static void usage(void); int main(int argc, char *argv[]) @@ -161,7 +148,7 @@ get_list(char *list) if (positions == NULL) { numpositions = ALLOC_CHUNK; - positions = ecalloc(numpositions, sizeof(*positions)); + positions = calloc(numpositions, sizeof(*positions)); } /* @@ -199,7 +186,7 @@ get_list(char *list) if (stop + 1 > numpositions) { size_t newsize; newsize = roundup(stop + 1, ALLOC_CHUNK); - positions = erealloc(positions, newsize); + positions = realloc(positions, newsize); (void)memset(positions + numpositions, 0, newsize - numpositions); numpositions = newsize; @@ -221,7 +208,7 @@ get_list(char *list) static void /*ARGSUSED*/ -f_cut(FILE *fp, const char *fname __unused) +f_cut(FILE *fp, const char *fname) { int ch, field, isdelim; char *pos, *p, sep; |