summaryrefslogtreecommitdiff
path: root/src/ptx.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-07 04:35:33 +0000
committerJim Meyering <jim@meyering.net>1999-03-07 04:35:33 +0000
commit81706baebd963d08ed295172d6117ac779b1eec1 (patch)
tree99ea804365dab2400953f2d1fbf0f44bdd34ef00 /src/ptx.c
parent59277d9406effa8b6c40bb9ad311e14eee58cc59 (diff)
downloadcoreutils-81706baebd963d08ed295172d6117ac779b1eec1.tar.xz
(swallow_file_in_memory): Use a `%s' format in error call,
in case the argument string contains a `%'.
Diffstat (limited to 'src/ptx.c')
-rw-r--r--src/ptx.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ptx.c b/src/ptx.c
index 798261c35..c343c2e82 100644
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -547,7 +547,7 @@ swallow_file_in_memory (const char *file_name, BLOCK *block)
file_handle = fileno (stdin);
else
if ((file_handle = open (file_name, O_RDONLY)) < 0)
- error (EXIT_FAILURE, errno, file_name);
+ error (EXIT_FAILURE, errno, "%s", file_name);
/* If the file is a plain, regular file, allocate the memory buffer all at
once and swallow the file in one blow. In other cases, read the file
@@ -555,7 +555,7 @@ swallow_file_in_memory (const char *file_name, BLOCK *block)
once in a while, as we go. */
if (fstat (file_handle, &stat_block) < 0)
- error (EXIT_FAILURE, errno, file_name);
+ error (EXIT_FAILURE, errno, "%s", file_name);
if (S_ISREG (stat_block.st_mode))
{
@@ -579,7 +579,7 @@ swallow_file_in_memory (const char *file_name, BLOCK *block)
else
#endif /* not MSDOS */
- error (EXIT_FAILURE, errno, file_name);
+ error (EXIT_FAILURE, errno, "%s", file_name);
}
block->end = block->start + in_memory_size;
}
@@ -604,7 +604,7 @@ swallow_file_in_memory (const char *file_name, BLOCK *block)
}
if (read_length < 0)
- error (EXIT_FAILURE, errno, file_name);
+ error (EXIT_FAILURE, errno, "%s", file_name);
block->end = block->start + used_length;
}
@@ -2130,7 +2130,7 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"),
{
fclose (stdout);
if (fopen (argv[optind], "w") == NULL)
- error (EXIT_FAILURE, errno, argv[optind]);
+ error (EXIT_FAILURE, errno, "%s", argv[optind]);
optind++;
}