replace strncmp by more appropriate memcmp