summaryrefslogtreecommitdiffstats
path: root/usr.bin/fmt
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2004-07-15 04:45:24 +0000
committertjr <tjr@FreeBSD.org>2004-07-15 04:45:24 +0000
commit8fb57041b781e0b4b3331d1f1900dcbf0ad3d325 (patch)
treee0d5b4553129251df4c6755401a2460f57dbafa8 /usr.bin/fmt
parent0389c188dede7411146ec973b6345a8fffff458a (diff)
downloadFreeBSD-src-8fb57041b781e0b4b3331d1f1900dcbf0ad3d325.zip
FreeBSD-src-8fb57041b781e0b4b3331d1f1900dcbf0ad3d325.tar.gz
Use warn() instead of perror().
Diffstat (limited to 'usr.bin/fmt')
-rw-r--r--usr.bin/fmt/fmt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/fmt/fmt.c b/usr.bin/fmt/fmt.c
index 0ad2bbc..a8662fd 100644
--- a/usr.bin/fmt/fmt.c
+++ b/usr.bin/fmt/fmt.c
@@ -362,7 +362,7 @@ main(int argc, char *argv[]) {
static void
process_named_file(const char *name) {
FILE *f=fopen(name, "r");
- if (!f) { perror(name); ++n_errors; }
+ if (!f) { warn("%s", name); ++n_errors; }
else {
process_stream(f, name);
fclose(f);
@@ -459,7 +459,7 @@ process_stream(FILE *stream, const char *name) {
++para_line_number;
}
new_paragraph(output_in_paragraph ? last_indent : first_indent, 0);
- if (ferror(stream)) { perror(name); ++n_errors; }
+ if (ferror(stream)) { warn("%s", name); ++n_errors; }
}
/* How long is the indent on this line?
@@ -586,7 +586,7 @@ center_stream(FILE *stream, const char *name) {
fwrite(line, 1, length, stdout);
putchar('\n');
}
- if (ferror(stream)) { perror(name); ++n_errors; }
+ if (ferror(stream)) { warn("%s", name); ++n_errors; }
}
/* Get a single line from a stream. Expand tabs, strip control
OpenPOWER on IntegriCloud