summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-05-28 22:21:24 -0500
committerKiyoshi Aman <kiyoshi.aman+adelie@gmail.com>2019-05-28 22:21:24 -0500
commit5bc967352f76c55a10aebaac0da03dfe8b704e40 (patch)
tree26aca37ab054f55c380e7dd43f27e0460d45b3e0 /usr.bin
parentc5f26b5b2ab1271e12dd08f5fe69ce96c8d25cdb (diff)
downloaduserland-5bc967352f76c55a10aebaac0da03dfe8b704e40.tar.gz
userland-5bc967352f76c55a10aebaac0da03dfe8b704e40.tar.bz2
userland-5bc967352f76c55a10aebaac0da03dfe8b704e40.tar.xz
userland-5bc967352f76c55a10aebaac0da03dfe8b704e40.zip
usr.bin/cut: make buildable
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cut/cut.c23
-rw-r--r--usr.bin/cut/x_cut.c2
2 files changed, 6 insertions, 19 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;
diff --git a/usr.bin/cut/x_cut.c b/usr.bin/cut/x_cut.c
index 006b5af..145905d 100644
--- a/usr.bin/cut/x_cut.c
+++ b/usr.bin/cut/x_cut.c
@@ -59,7 +59,7 @@
/* ARGSUSED */
void
-CUT_FN(FILE *fp, const char *fname __unused)
+CUT_FN(FILE *fp, const char *fname)
{
CUT_CH_T ch;
int col;