fix handling of odd lengths in swab function
authorRich Felker <dalias@aerifal.cx>
Sat, 4 Oct 2014 15:14:01 +0000 (11:14 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 4 Oct 2014 15:14:01 +0000 (11:14 -0400)
commitdccbf4c809efc311aa37da71de70d04dfd8b0db3
treee2651ba2140ab3d6b0a3b07e2d5f75df29cccfbb
parent05cef96d9e63a00b319f88343cf9869c8e612843
fix handling of odd lengths in swab function

this function is specified to leave the last byte with "unspecified
disposition" when the length is odd, so for the most part correct
programs should not be calling swab with odd lengths. however, doing
so is permitted, and should not write past the end of the destination
buffer.
src/string/swab.c