sanitize socket buffer to remove premature null chars. closes #219