summaryrefslogtreecommitdiff
path: root/src/tail.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-11-05 20:32:55 +0000
committerJim Meyering <jim@meyering.net>2002-11-05 20:32:55 +0000
commit371e50492eea5206d4b4b170e2aae812ac4bfc28 (patch)
treea49060b54906383db948fcc65efa76253f63dd58 /src/tail.c
parent4c16b8d35a631c86bdac8296d8d7a96eb70c7287 (diff)
downloadcoreutils-371e50492eea5206d4b4b170e2aae812ac4bfc28.tar.xz
(xlseek):
Use primitives from inttostr.h, not human.h, to print large numbers simply.
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/tail.c b/src/tail.c
index dadb5e53c..dad6da484 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -35,7 +35,7 @@
#include "closeout.h"
#include "argmatch.h"
#include "error.h"
-#include "human.h"
+#include "inttostr.h"
#include "posixver.h"
#include "safe-read.h"
#include "xnanosleep.h"
@@ -378,32 +378,27 @@ static void
xlseek (int fd, off_t offset, int whence, char const *filename)
{
off_t new_offset = lseek (fd, offset, whence);
- char buf[LONGEST_HUMAN_READABLE + 1];
+ char buf[INT_BUFSIZE_BOUND (off_t)];
char *s;
- char const *sign;
if (0 <= new_offset)
return;
- sign = offset < 0 ? "-" : "";
- if (offset < 0)
- offset = -offset;
-
- s = human_readable ((uintmax_t) offset, buf, 1, 1);
+ s = offtostr (offset, buf);
switch (whence)
{
case SEEK_SET:
- error (EXIT_FAILURE, errno, _("%s: cannot seek to offset %s%s"),
- filename, sign, s);
+ error (EXIT_FAILURE, errno, _("%s: cannot seek to offset %s"),
+ filename, s);
break;
case SEEK_CUR:
- error (EXIT_FAILURE, errno, _("%s: cannot seek to relative offset %s%s"),
- filename, sign, s);
+ error (EXIT_FAILURE, errno, _("%s: cannot seek to relative offset %s"),
+ filename, s);
break;
case SEEK_END:
error (EXIT_FAILURE, errno,
- _("%s: cannot seek to end-relative offset %s%s"),
- filename, sign, s);
+ _("%s: cannot seek to end-relative offset %s"),
+ filename, s);
break;
default:
abort ();