make strerror_r behave nicer on failure
authorRich Felker <dalias@aerifal.cx>
Wed, 20 Jun 2012 16:07:18 +0000 (12:07 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 20 Jun 2012 16:07:18 +0000 (12:07 -0400)
commitf313a1622448de578ab0b11a881f44a02c9082e6
tree1a1aa9a886cdadf5371cae8d7cc7f782b71c28cb
parent839bff64a17c1ecaed60feefd9b63554ca9cbad6
make strerror_r behave nicer on failure

if the buffer is too short, at least return a partial string. this is
helpful if the caller is lazy and does not check for failure. care is
taken to avoid writing anything if the buffer length is zero, and to
always null-terminate when the buffer length is non-zero.
src/string/strerror_r.c