From c771f143db93805f89109006d908771ced2a632a Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 7 Mar 1999 04:52:49 +0000 Subject: [PATCH] (main): Use a `%s' format in error call, in case the argument string contains a `%'. --- src/fmt.c | 4 ++-- src/sort.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fmt.c b/src/fmt.c index 7aa973885..d27a4d8f4 100644 --- a/src/fmt.c +++ b/src/fmt.c @@ -397,10 +397,10 @@ main (register int argc, register char **argv) { fmt (in_stream); if (fclose (in_stream) == EOF) - error (EXIT_FAILURE, errno, file); + error (EXIT_FAILURE, errno, "%s", file); } else - error (0, errno, file); + error (0, errno, "%s", file); } } } diff --git a/src/sort.c b/src/sort.c index 69a4332a4..ee0514b76 100644 --- a/src/sort.c +++ b/src/sort.c @@ -2961,7 +2961,7 @@ but lacks following character offset")); error (SORT_FAILURE, errno, _("%s: write error"), outfile); if (have_read_stdin && fclose (stdin) == EOF) - error (SORT_FAILURE, errno, outfile); + error (SORT_FAILURE, errno, "%s", outfile); if (ferror (stdout) || fclose (stdout) == EOF) error (SORT_FAILURE, errno, _("%s: write error"), outfile); -- 2.34.1