From 5059d0a4ee1fb110f568e385c2e6c9275e0a4b8d Mon Sep 17 00:00:00 2001 From: mike Date: Wed, 11 Sep 2002 04:26:09 +0000 Subject: [PATCH] Some uses of the variable n needed to be int, others needed to be size_t. Add a new variable to cope. --- usr.bin/uudecode/uudecode.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c index 82be8c015351..705ab29d5a3a 100644 --- a/usr.bin/uudecode/uudecode.c +++ b/usr.bin/uudecode/uudecode.c @@ -152,7 +152,7 @@ decode(void) int decode2(void) { - int base64; + int base64, i; size_t n; char ch, *p, *q; void *mode; @@ -261,13 +261,13 @@ decode2(void) } while (0) /* - * `n' is used to avoid writing out all the characters + * `i' is used to avoid writing out all the characters * at the end of the file. */ - if ((n = DEC(*p)) <= 0) + if ((i = DEC(*p)) <= 0) break; - for (++p; n > 0; p += 4, n -= 3) - if (n >= 3) { + for (++p; i > 0; p += 4, i -= 3) + if (i >= 3) { if (!(IS_DEC(*p) && IS_DEC(*(p + 1)) && IS_DEC(*(p + 2)) && IS_DEC(*(p + 3)))) OUT_OF_RANGE; @@ -280,13 +280,13 @@ decode2(void) putchar(ch); } else { - if (n >= 1) { + if (i >= 1) { if (!(IS_DEC(*p) && IS_DEC(*(p + 1)))) OUT_OF_RANGE; ch = DEC(p[0]) << 2 | DEC(p[1]) >> 4; putchar(ch); } - if (n >= 2) { + if (i >= 2) { if (!(IS_DEC(*(p + 1)) && IS_DEC(*(p + 2)))) OUT_OF_RANGE; @@ -294,7 +294,7 @@ decode2(void) ch = DEC(p[1]) << 4 | DEC(p[2]) >> 2; putchar(ch); } - if (n >= 3) { + if (i >= 3) { if (!(IS_DEC(*(p + 2)) && IS_DEC(*(p + 3)))) OUT_OF_RANGE;