fix reckoning of length of POST input residue

stick a nul at end of buffer and use strlen