this is way too dangerous (sizeof), if pass in an array like this you should either (1) pass in an explicit length parameter (more safe) or require array NULL termination (more convenient).