Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 1999 01:18:48 -0600
From:      Warner Losh <imp@village.org>
To:        "Brian F. Feldman" <green@FreeBSD.ORG>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: interesting bug in /usr/bin/cmp 
Message-ID:  <199907290718.BAA74680@harmony.village.org>
In-Reply-To: Your message of "Thu, 29 Jul 1999 00:52:27 EDT." <Pine.BSF.4.10.9907290051210.3955-100000@janus.syracuse.net> 
References:  <Pine.BSF.4.10.9907290051210.3955-100000@janus.syracuse.net>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.10.9907290051210.3955-100000@janus.syracuse.net> "Brian F. Feldman" writes:
:  	if ((p1 = (u_char *)mmap(NULL,
: -	    (size_t)length, PROT_READ, MAP_SHARED, fd1, off1)) == (u_char *)MAP_FAILED)
: +	    (size_t)mlength, PROT_READ, MAP_SHARED, fd1, off1)) == (u_char *)MAP_FAILED)
:  		err(ERR_EXIT, "%s", file1);

This would be a good candiate for different line breaks for clarity

  	if ((p1 = (u_char *)mmap(NULL, (size_t)mlength, PROT_READ, MAP_SHARED,
	    fd1, off1)) == (u_char *)MAP_FAILED)

would be more readable and not violate the 80 column rule.  Since the
call to mmap is already split and you are already changing it, I don't 
think this would be a problem.  While I do try to minimize stylistic
changes, I think this one makes good sense....

: -	    (size_t)length, PROT_READ, MAP_SHARED, fd2, off2)) == (u_char *)MAP_FAILED)
: +	    (size_t)mlength, PROT_READ, MAP_SHARED, fd2, off2)) == (u_char *)MAP_FAILED)
:  		err(ERR_EXIT, "%s", file2);

See above :-)

Warner


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199907290718.BAA74680>