summaryrefslogtreecommitdiffstats
path: root/bin/cp/cp.c
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2002-02-22 21:24:14 +0000
committermarkm <markm@FreeBSD.org>2002-02-22 21:24:14 +0000
commit2b941891dbad5a4edcf64325cbd3a6cf9f8b0931 (patch)
tree7df96d0a81d721bfad76255e68d1542c4a161f7b /bin/cp/cp.c
parent3ce9528bfb2bfddd566fc2750966b7fc0b2a8a93 (diff)
downloadFreeBSD-src-2b941891dbad5a4edcf64325cbd3a6cf9f8b0931.zip
FreeBSD-src-2b941891dbad5a4edcf64325cbd3a6cf9f8b0931.tar.gz
Fix warnings inspired by lint, a commercial lint and WARNS=4.
Diffstat (limited to 'bin/cp/cp.c')
-rw-r--r--bin/cp/cp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index 0aede8b..21439d8a 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -82,9 +82,12 @@ static const char rcsid[] =
*--(p).p_end = 0; \
}
-PATH_T to = { to.p_path, "", "" };
+static char emptystring[] = "";
-int Rflag, iflag, pflag, rflag, fflag, vflag;
+PATH_T to = { to.p_path, emptystring, "" };
+
+int iflag, pflag, fflag;
+static int Rflag, rflag, vflag;
enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE };
@@ -241,7 +244,8 @@ copy(char *argv[], enum op type, int fts_options)
struct stat to_stat;
FTS *ftsp;
FTSENT *curr;
- int base = 0, dne, badcp, nlen, rval;
+ int base = 0, dne, badcp, rval;
+ size_t nlen;
char *p, *target_mid;
mode_t mask, mode;
@@ -267,6 +271,7 @@ copy(char *argv[], enum op type, int fts_options)
warnx("%s: directory causes a cycle", curr->fts_path);
badcp = rval = 1;
continue;
+ default:
}
/*
@@ -370,7 +375,8 @@ copy(char *argv[], enum op type, int fts_options)
}
if (!S_ISDIR(curr->fts_statp->st_mode) &&
S_ISDIR(to_stat.st_mode)) {
- warnx("cannot overwrite directory %s with non-directory %s",
+ warnx("cannot overwrite directory %s with "
+ "non-directory %s",
to.p_path, curr->fts_path);
badcp = rval = 1;
continue;
OpenPOWER on IntegriCloud