summaryrefslogtreecommitdiff
path: root/src/head.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-06-07 07:15:15 +0200
committerJim Meyering <meyering@redhat.com>2010-06-08 13:16:26 +0200
commit9e7edd8467232b5c6b714d588d0e1528cc54151b (patch)
tree3894cfe54cb210dbaf5a58a02e72600afc04141b /src/head.c
parentad89ea6a0dc4a404871f87eef6e9727c07f4cfb6 (diff)
downloadcoreutils-9e7edd8467232b5c6b714d588d0e1528cc54151b.tar.xz
maint: adjust INT_BUFSIZE_BOUND usage for maintainability
* src/tail.c (xlseek): Give INT_BUFSIZE_BOUND a variable name, not a type name. * src/ls.c (gobble_file, format_user_or_group_width): Likewise. * src/head.c (elide_tail_bytes_pipe): Likewise. (elide_tail_lines_seekable, main): Likewise. [This change is not complete -- there are doubtless other uses that can be updated in the same way.]
Diffstat (limited to 'src/head.c')
-rw-r--r--src/head.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/head.c b/src/head.c
index 7fa5823eb..dd3dc894c 100644
--- a/src/head.c
+++ b/src/head.c
@@ -226,7 +226,7 @@ elide_tail_bytes_pipe (const char *filename, int fd, uintmax_t n_elide_0)
if (SIZE_MAX < n_elide_0 + READ_BUFSIZE)
{
- char umax_buf[INT_BUFSIZE_BOUND (uintmax_t)];
+ char umax_buf[INT_BUFSIZE_BOUND (n_elide_0)];
error (EXIT_FAILURE, 0, _("%s: number of bytes is too large"),
umaxtostr (n_elide_0, umax_buf));
}
@@ -611,7 +611,7 @@ elide_tail_lines_seekable (const char *pretty_filename, int fd,
pos -= bytes_read;
if (lseek (fd, pos, SEEK_SET) < 0)
{
- char offset_buf[INT_BUFSIZE_BOUND (off_t)];
+ char offset_buf[INT_BUFSIZE_BOUND (pos)];
error (0, errno, _("%s: cannot seek to offset %s"),
pretty_filename, offtostr (pos, offset_buf));
return false;
@@ -682,7 +682,7 @@ elide_tail_lines_seekable (const char *pretty_filename, int fd,
pos -= BUFSIZ;
if (lseek (fd, pos, SEEK_SET) < 0)
{
- char offset_buf[INT_BUFSIZE_BOUND (off_t)];
+ char offset_buf[INT_BUFSIZE_BOUND (pos)];
error (0, errno, _("%s: cannot seek to offset %s"),
pretty_filename, offtostr (pos, offset_buf));
return false;
@@ -1042,7 +1042,7 @@ main (int argc, char **argv)
if ( ! count_lines && elide_from_end && OFF_T_MAX < n_units)
{
- char umax_buf[INT_BUFSIZE_BOUND (uintmax_t)];
+ char umax_buf[INT_BUFSIZE_BOUND (n_units)];
error (EXIT_FAILURE, 0, _("%s: number of bytes is too large"),
umaxtostr (n_units, umax_buf));
}