[BusyBox-cvs] busybox/coreutils dos2unix.c,1.19,1.20

Erik Andersen andersen at busybox.net
Wed May 5 19:39:23 UTC 2004


Update of /var/cvs/busybox/coreutils
In directory nail:/tmp/cvs-serv24084/coreutils

Modified Files:
	dos2unix.c 
Log Message:
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



Index: dos2unix.c
===================================================================
RCS file: /var/cvs/busybox/coreutils/dos2unix.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- a/dos2unix.c	5 May 2004 10:37:49 -0000	1.19
+++ b/dos2unix.c	5 May 2004 19:39:21 -0000	1.20
@@ -64,7 +64,9 @@
 		c = strlen(tempFn);
 		tempFn[c] = '.';
 		while(1) {
-		    if (c >=BUFSIZ-2)
+		    /* tempFn is BUFSIZ so the last addressable spot it BUFSIZ-1.
+		     * The loop increments by 2. So this must check for BUFSIZ-3. */
+		    if (c >=BUFSIZ-3)
 			bb_error_msg_and_die("unique name not found");
 		    /* Get some semi random stuff to try and make a
 		     * random filename based (and in the same dir as)




More information about the busybox-cvs mailing list