Fixes uninitialized data in tmp filename
authorRobin Luckey <rluckey@blackducksoftware.com>
Fri, 21 Jan 2011 15:46:45 +0000 (07:46 -0800)
committerRobin Luckey <rluckey@blackducksoftware.com>
Fri, 21 Jan 2011 15:46:45 +0000 (07:46 -0800)
commitd9ceacdeebbd3d603518fc67af164637f8dd608c
tree6d38dc79da4130b09bd7160c753fab0c407c35f3
parentae5acfebe8670a5f076e06d881643992110896ce
Fixes uninitialized data in tmp filename

The filename string used for the detector's temporary file had an
uninitialized byte at its end. Usually this byte is 0, so it has no ill
effect. Occasionally it can be a garbage byte, which can cause the
temporary file write() to fail.

Because Ohcount had been failing to check write()'s return value, these
errors went unnoticed, and incorrect line counts were silently returned.

I have fixed the uninitialized byte, and the previous commit adds
the appropriate error checks.

All code counted prior to this fix should be recounted.
src/detector.c