From 5bc967352f76c55a10aebaac0da03dfe8b704e40 Mon Sep 17 00:00:00 2001 From: Kiyoshi Aman Date: Tue, 28 May 2019 22:21:24 -0500 Subject: usr.bin/cut: make buildable --- usr.bin/cut/cut.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'usr.bin/cut/cut.c') 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 -#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 #include #include @@ -52,9 +39,9 @@ __RCSID("$NetBSD: cut.c,v 1.29 2014/02/03 20:22:19 wiz Exp $"); #include #include #include +#include #include #include -#include #include #include @@ -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; -- cgit v1.2.3-60-g2f50