aboutsummaryrefslogtreecommitdiff
path: root/coreutils/dos2unix.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-05-05 19:39:21 +0000
committerEric Andersen <andersen@codepoet.org>2004-05-05 19:39:21 +0000
commit6c0396ba2ab4bf10535ef43c486c1836786fc97e (patch)
treeb18a523a463a9ca06a9c85fbb16305c87da22cce /coreutils/dos2unix.c
parentaaff79a8dd00f2a9652a4bce8fbfe77715804ac2 (diff)
downloadbusybox-w32-6c0396ba2ab4bf10535ef43c486c1836786fc97e.tar.gz
busybox-w32-6c0396ba2ab4bf10535ef43c486c1836786fc97e.tar.bz2
busybox-w32-6c0396ba2ab4bf10535ef43c486c1836786fc97e.zip
Steve Grubb writes:
Hi, I just re-reviewed the patch I just sent...and it needed to be BUFSIZ-3 in dos2unix.c . tempFn is BUFSIZ so the last addressable spot it BUFSIZ-1. The loop increments by 2. That's why it should be BUFSIZ-3. Best Regards, Steve Grubb
Diffstat (limited to 'coreutils/dos2unix.c')
-rw-r--r--coreutils/dos2unix.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c
index c8cebcec7..df0b4f977 100644
--- a/coreutils/dos2unix.c
+++ b/coreutils/dos2unix.c
@@ -64,7 +64,9 @@ static int convert(char *fn, int ConvType)
64 c = strlen(tempFn); 64 c = strlen(tempFn);
65 tempFn[c] = '.'; 65 tempFn[c] = '.';
66 while(1) { 66 while(1) {
67 if (c >=BUFSIZ-2) 67 /* tempFn is BUFSIZ so the last addressable spot it BUFSIZ-1.
68 * The loop increments by 2. So this must check for BUFSIZ-3. */
69 if (c >=BUFSIZ-3)
68 bb_error_msg_and_die("unique name not found"); 70 bb_error_msg_and_die("unique name not found");
69 /* Get some semi random stuff to try and make a 71 /* Get some semi random stuff to try and make a
70 * random filename based (and in the same dir as) 72 * random filename based (and in the same dir as)