summaryrefslogtreecommitdiff
path: root/coreutils/tr.c
diff options
context:
space:
mode:
authorEric Andersen2001-03-21 07:34:27 +0000
committerEric Andersen2001-03-21 07:34:27 +0000
commit1ca20a77476fb69e2472080ef6ba23c8c0ad12ad (patch)
treed1f07be4de0004fe5e30b44320e10285147e7944 /coreutils/tr.c
parent7447642a47c6a0aefd05f4acf730950a510634cd (diff)
downloadbusybox-1ca20a77476fb69e2472080ef6ba23c8c0ad12ad.zip
busybox-1ca20a77476fb69e2472080ef6ba23c8c0ad12ad.tar.gz
A nice patch from Larry Doolittle that adds -Wshadow and
cleans up most of the now-revealed problems.
Diffstat (limited to 'coreutils/tr.c')
-rw-r--r--coreutils/tr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/coreutils/tr.c b/coreutils/tr.c
index b7a6009..ddb7387 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -123,19 +123,19 @@ static unsigned int expand(char *arg, register unsigned char *buffer)
static int complement(unsigned char *buffer, int buffer_len)
{
- register short i, j, index;
+ register short i, j, ix;
char conv[ASCII + 2];
- index = 0;
+ ix = 0;
for (i = 0; i <= ASCII; i++) {
for (j = 0; j < buffer_len; j++)
if (buffer[j] == i)
break;
if (j == buffer_len)
- conv[index++] = i & ASCII;
+ conv[ix++] = i & ASCII;
}
- memcpy(buffer, conv, index);
- return index;
+ memcpy(buffer, conv, ix);
+ return ix;
}
extern int tr_main(int argc, char **argv)