Better character classes and wording

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
dont entrust sprintf to encode binary packets
encode result code with right length, pointed out by Rangar Sundblad, thanks!