use strncasecmp() instead of strncmp()