adjusting workaround to skip '\0' in crooked inputs