fix wrong length for strncpy, overrunning the buffer, thanks HavokOC