summaryrefslogtreecommitdiff
path: root/src/tr.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-10-08 07:14:48 +0000
committerJim Meyering <jim@meyering.net>2002-10-08 07:14:48 +0000
commitffd20427d8b7966c91a2245ea6987d67b5fe194d (patch)
treeddbf3c9ec26416ca636eeba95c267c0398476fc4 /src/tr.c
parentc52b7838fa87f10dc0c1faa2a07918544e6d9df7 (diff)
downloadcoreutils-ffd20427d8b7966c91a2245ea6987d67b5fe194d.tar.xz
Rename local variable: chars_read -> bytes_read
Diffstat (limited to 'src/tr.c')
-rw-r--r--src/tr.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/tr.c b/src/tr.c
index c9e8c9ae8..ee21b2f88 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -1740,7 +1740,7 @@ read_and_delete (unsigned char *buf, size_t size, Filter not_used)
static size_t
read_and_xlate (unsigned char *buf, size_t size, Filter not_used)
{
- size_t chars_read = 0;
+ size_t bytes_read = 0;
static int hit_eof = 0;
size_t i;
@@ -1749,19 +1749,19 @@ read_and_xlate (unsigned char *buf, size_t size, Filter not_used)
if (hit_eof)
return 0;
- chars_read = safe_read (0, (char *) buf, size);
- if (chars_read == SAFE_READ_ERROR)
+ bytes_read = safe_read (0, (char *) buf, size);
+ if (bytes_read == SAFE_READ_ERROR)
error (EXIT_FAILURE, errno, _("read error"));
- if (chars_read == 0)
+ if (bytes_read == 0)
{
hit_eof = 1;
return 0;
}
- for (i = 0; i < chars_read; i++)
+ for (i = 0; i < bytes_read; i++)
buf[i] = xlate[buf[i]];
- return chars_read;
+ return bytes_read;
}
/* Initialize a boolean membership set IN_SET with the character
@@ -2010,16 +2010,16 @@ construct in string1 must be aligned with a corresponding construct\n\
}
else
{
- size_t chars_read;
+ size_t bytes_read;
do
{
- chars_read = read_and_xlate (io_buf, IO_BUF_SIZE, NULL);
- if (chars_read > 0
- && fwrite ((char *) io_buf, 1, chars_read, stdout) == 0)
+ bytes_read = read_and_xlate (io_buf, IO_BUF_SIZE, NULL);
+ if (bytes_read > 0
+ && fwrite ((char *) io_buf, 1, bytes_read, stdout) == 0)
error (EXIT_FAILURE, errno, _("write error"));
}
- while (chars_read > 0);
+ while (bytes_read > 0);
}
}