try removing the newline from the end of the string before comparing , here's a simple function to does that :
void removeNLine(char* string)
{
int i ;
for(i = strlen(string) ; i > 0 ; i--)
if(string[i] == '\n')
string[i] = '\0';
}