|
|
||
|
On Feb 20, 2014, at 20:29 , Cezary H. Noweta wrote:
Btw. aside that you enter a field of high speculation about touching bytes beyond the actual string copy (which no C library we looked a so far does) we only have to pre fill the buffer with \n for a highly exceptional case, namely: the last line of the file (EOF) not having a newline. And yet my proposed patch handles this case if the C library does not do your additional magical buffer trashing. For all other lines of the file the termination is guaranteed to be a newline: If a newline is read, it is stored into the buffer. René -- ExactCODE GmbH, Jaegerstr. 67, DE-10117 Berlin http://exactcode.com | http://exactscan.com | http://ocrkit.com | http://t2-project.org | http://rene.rebe.de |