Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/usr.bin/make



On Fri, Feb 15, 2008 at 08:08:12PM +0000, Christos Zoulas wrote:
 > Module Name: src
 > Committed By:        christos
 > Date:                Fri Feb 15 20:08:12 UTC 2008
 > 
 > Modified Files:
 >      src/usr.bin/make: job.c
 > 
 > Log Message:
 > Improve dh's fix:
 >      - make sure i is initialized
 >      - don't subtract 1 in comparison, add 1 to the other side

Does that really fix it? If max is 0, then job->curPos and nr must
also both be 0, in which case gotNL must be false and fbuf cannot be
set to true, and the comparison you fixed can't be reached. (And the
value of i isn't used.)

If the above reasoning is correct, and this change nonetheless alters
the behavior, then probably job->curPos is coming up invalid and we
haven't really fixed the problem but only masked it...

(Also, while I'm kibitzing, the default-case value for i should be
job->curPos, not job->curPos-1, because it's going to overwrite that
position with a \0 and it thus shouldn't be a slot that's already
used. The buffer is sized so there's space.)

-- 
   - David A. Holland / dholland+netbsd%eecs.harvard.edu@localhost


Home | Main Index | Thread Index | Old Index