in rev 16374, bb_get_chunk_from_file() was tweaked by adding another call to 
realloc() in case the buffer happened to be filled up completely ... however, 
this is done unconditionally which often leads to an extra realloc() call 
(whenever a line is not a multiple of 80 characters).  this managed to expose 
a bug in uClibc's simple realloc() when the new size requested is actually 
smaller than the old size (people rarely use realloc() to *shrink* buffers, 
they use it to *expand* buffers).  regardless, i'd propose this simple 
change:
+if (!((idx+1) % 80))
 linebuf = xrealloc(linebuf, idx+1);

quick link for peeps:
http://busybox.net/cgi-bin/viewcvs.cgi?view=rev&rev=16374
-mike

Attachment: pgps3yauIxyEa.pgp
Description: PGP signature

_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to