fix buffer overflow found by zacts from IRC (bad length calculation)
now zsh and mksh are even… :|