summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-07-10 09:14:15 +0000
committerkris <kris@FreeBSD.org>2000-07-10 09:14:15 +0000
commit74a1be3402cdf41e683eb2ad6e6967a9a09269fd (patch)
tree6194aa20dae4554ce49c6f047f381a9a927655f7 /usr.bin
parentd84b4d3f4d875bdc29e1af239bfea2dadaff8f85 (diff)
downloadFreeBSD-src-74a1be3402cdf41e683eb2ad6e6967a9a09269fd.zip
FreeBSD-src-74a1be3402cdf41e683eb2ad6e6967a9a09269fd.tar.gz
Don't call err() with no format string.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/indent/indent.c14
-rw-r--r--usr.bin/ktrace/ktrace.c10
-rw-r--r--usr.bin/kzip/kzip.c16
-rw-r--r--usr.bin/lam/lam.c2
4 files changed, 21 insertions, 21 deletions
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index 02d3444..08977bd 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -189,7 +189,7 @@ main(argc, argv)
in_name = argv[i]; /* remember name of input file */
input = fopen(in_name, "r");
if (input == 0) /* check for open error */
- err(1, in_name);
+ err(1, "%s", in_name);
continue;
}
else if (output == 0) { /* we have the output file */
@@ -200,7 +200,7 @@ main(argc, argv)
}
output = fopen(out_name, "w");
if (output == 0) /* check for create error */
- err(1, out_name);
+ err(1, "%s", out_name);
continue;
}
errx(1, "unknown parameter: %s", argv[i]);
@@ -1160,23 +1160,23 @@ bakcopy()
/* copy in_name to backup file */
bakchn = creat(bakfile, 0600);
if (bakchn < 0)
- err(1, bakfile);
+ err(1, "%s", bakfile);
while (n = read(fileno(input), buff, sizeof buff))
if (write(bakchn, buff, n) != n)
- err(1, bakfile);
+ err(1, "%s", bakfile);
if (n < 0)
- err(1, in_name);
+ err(1, "%s", in_name);
close(bakchn);
fclose(input);
/* re-open backup file as the input file */
input = fopen(bakfile, "r");
if (input == 0)
- err(1, bakfile);
+ err(1, "%s", bakfile);
/* now the original input file will be the output */
output = fopen(in_name, "w");
if (output == 0) {
unlink(bakfile);
- err(1, in_name);
+ err(1, "%s", in_name);
}
}
diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c
index 1c5a98b..48d4871 100644
--- a/usr.bin/ktrace/ktrace.c
+++ b/usr.bin/ktrace/ktrace.c
@@ -136,14 +136,14 @@ main(argc, argv)
ops |= pid ? KTROP_CLEAR : KTROP_CLEARFILE;
if (ktrace(tracefile, ops, trpoints, pid) < 0)
- err(1, tracefile);
+ err(1, "%s", tracefile);
exit(0);
}
omask = umask(S_IRWXG|S_IRWXO);
if (append) {
if ((fd = open(tracefile, O_CREAT | O_WRONLY, DEFFILEMODE)) < 0)
- err(1, tracefile);
+ err(1, "%s", tracefile);
if (fstat(fd, &sb) != 0 || sb.st_uid != getuid())
errx(1, "Refuse to append to %s not owned by you.",
tracefile);
@@ -152,19 +152,19 @@ main(argc, argv)
err(1, "unlink %s", tracefile);
if ((fd = open(tracefile, O_CREAT | O_EXCL | O_WRONLY,
DEFFILEMODE)) < 0)
- err(1, tracefile);
+ err(1, "%s", tracefile);
}
(void)umask(omask);
(void)close(fd);
if (*argv) {
if (ktrace(tracefile, ops, trpoints, getpid()) < 0)
- err(1, tracefile);
+ err(1, "%s", tracefile);
execvp(argv[0], &argv[0]);
err(1, "exec of '%s' failed", argv[0]);
}
else if (ktrace(tracefile, ops, trpoints, pid) < 0)
- err(1, tracefile);
+ err(1, "%s", tracefile);
exit(0);
}
diff --git a/usr.bin/kzip/kzip.c b/usr.bin/kzip/kzip.c
index 97e1a4d..5af945a 100644
--- a/usr.bin/kzip/kzip.c
+++ b/usr.bin/kzip/kzip.c
@@ -85,13 +85,13 @@ main(int argc, char **argv)
fdi = open(kernname ,O_RDONLY);
if(fdi<0) {
- warn(kernname);
+ warn("%s", kernname);
return 2;
}
/* figure out how big the uncompressed image will be */
if (read (fdi, (char *)&hdr, sizeof(hdr)) != sizeof(hdr))
- err(2, argv[1]);
+ err(2, "%s", argv[1]);
size = hdr.a_text + hdr.a_data + hdr.a_bss;
entry = hdr.a_entry & 0x00FFFFFF;
@@ -106,7 +106,7 @@ main(int argc, char **argv)
fdo = open(obj,O_WRONLY|O_TRUNC|O_CREAT,0666);
if(fdo<0) {
- warn(obj);
+ warn("%s", obj);
return 2;
}
@@ -222,13 +222,13 @@ main(int argc, char **argv)
fdn = open(obj ,O_RDONLY);
if(fdn<0) {
- warn(obj);
+ warn("%s", obj);
return 3;
}
/* figure out how big the compressed image is */
if (read (fdn, (char *)&hdr, sizeof(hdr)) != sizeof(hdr)) {
- warn(obj);
+ warn("%s", obj);
return 3;
}
close(fdn);
@@ -251,11 +251,11 @@ extract (char *file)
struct exec hdr;
if (read (0, (char *)&hdr, sizeof(hdr)) != sizeof(hdr))
- err(2, file);
+ err(2, "%s", file);
if (hdr.a_magic != ZMAGIC)
errx(2, "bad magic in file %s, probably not a kernel", file);
if (lseek (0, N_TXTOFF(hdr), 0) < 0)
- err(2, file);
+ err(2, "%s", file);
sz = N_SYMOFF (hdr) - N_TXTOFF (hdr);
@@ -269,7 +269,7 @@ extract (char *file)
n = read (0, buf, l);
if (n != l) {
if (n == -1)
- err(1, file);
+ err(1, "%s", file);
else
errx(1, "unexpected EOF");
}
diff --git a/usr.bin/lam/lam.c b/usr.bin/lam/lam.c
index 2770810..e65df36 100644
--- a/usr.bin/lam/lam.c
+++ b/usr.bin/lam/lam.c
@@ -118,7 +118,7 @@ getargs(av)
if (*p == '-')
ip->fp = stdin;
else if ((ip->fp = fopen(p, "r")) == NULL) {
- err(1, p);
+ err(1, "%s", p);
}
ip->pad = P;
if (!ip->sepstring)
OpenPOWER on IntegriCloud