use strncmp instead of memcmp