ethersex/ethersex — pull request #155 by owagner (2012-06-29 11:49:32+00:00)
Title: - UDP ECMD parsing was broken for the case that UDP packets without trai...

...ling

\r or \n were received, due to a wrong loop termination condition
(<= instead of<) and a one-off too small temporary buffer. Also,
strncpy doesn't \0-terminate when hitting the size limit.

This commit rewrites the parsing in a different way, fixing this problem
and also merging the initial scan and the temporary copy into a single
loop. The implementation has the disadvantage of potentially allocating
the temporary buffer one or two bytes too large when a \r\n is indeed
present in the packet, but this should be neglectible.