summaryrefslogtreecommitdiffstats
path: root/usr.bin/cut/cut.c
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-06-07 09:13:43 +0000
committertjr <tjr@FreeBSD.org>2002-06-07 09:13:43 +0000
commitef796a5f354641fd12b304f2f83cd83a612d3574 (patch)
tree6e5e5f260b993bed66d33b6749c76d9c9ede66e1 /usr.bin/cut/cut.c
parent97653820111cf879c1a59bd107cd0725c4e18886 (diff)
downloadFreeBSD-src-ef796a5f354641fd12b304f2f83cd83a612d3574.zip
FreeBSD-src-ef796a5f354641fd12b304f2f83cd83a612d3574.tar.gz
style(9): don't initialise variables in their declaration, remove space
after function name, use __unused on unused parameters instead of initialising them to bogus values.
Diffstat (limited to 'usr.bin/cut/cut.c')
-rw-r--r--usr.bin/cut/cut.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/usr.bin/cut/cut.c b/usr.bin/cut/cut.c
index c229948..461dc86 100644
--- a/usr.bin/cut/cut.c
+++ b/usr.bin/cut/cut.c
@@ -58,12 +58,12 @@ int dflag;
int fflag;
int sflag;
-void c_cut (FILE *, const char *);
-void f_cut (FILE *, const char *);
-void get_list (char *);
-int main (int, char **);
+void c_cut(FILE *, const char *);
+void f_cut(FILE *, const char *);
+void get_list(char *);
+int main(int, char **);
void needpos(size_t);
-static void usage (void);
+static void usage(void);
int
main(argc, argv)
@@ -71,12 +71,12 @@ main(argc, argv)
char *argv[];
{
FILE *fp;
- void (*fcn) (FILE *, const char *) = NULL;
+ void (*fcn)(FILE *, const char *);
int ch, rval;
- fcn = NULL;
- setlocale (LC_ALL, "");
+ setlocale(LC_ALL, "");
+ fcn = NULL;
dchar = '\t'; /* default delimiter is \t */
/* Since we don't support multi-byte characters, the -c and -b
@@ -217,15 +217,13 @@ needpos(size_t n)
}
}
-/* ARGSUSED */
void
c_cut(fp, fname)
FILE *fp;
- const char *fname;
+ const char *fname __unused;
{
int ch, col;
char *pos;
- fname = NULL;
ch = 0;
for (;;) {
@@ -257,9 +255,10 @@ f_cut(fp, fname)
int ch, field, isdelim;
char *pos, *p, sep;
int output;
- char *lbuf, *mlbuf = NULL;
+ char *lbuf, *mlbuf;
size_t lbuflen;
+ mlbuf = NULL;
for (sep = dchar; (lbuf = fgetln(fp, &lbuflen)) != NULL;) {
/* Assert EOL has a newline. */
if (*(lbuf + lbuflen - 1) != '\n') {
OpenPOWER on IntegriCloud