A solution, rather than changing one of the strings
and remove line breaks, can go through implementing a comparison your.
An example of this comparison would be (based slightly on this reply):
// Retorna 0 se as strings forem iguais, -1 se forem diferentes
int CompareStrings(char* a, char* b);
int CompareStrings(char* a, char* b)
{
int indexA, indexB;
for(indexA = 0, indexB = 0; indexA < strlen(a) || indexB < strlen(b); ++indexA, ++indexB)
{
if(a[indexA] == '\n')
{
if(++indexA >= strlen(a))
indexA = strlen(a);
}
if(b[indexB] == '\n')
{
if(++indexB >= strlen(b))
indexB = strlen(b);
}
if((a[indexA] == '\0' || b[indexB] == '\0') || (a[indexA] != b[indexB]))
break;
}
// Se ambos terminaram, as strings contidas são iguais.
if( a[indexA] == '\0' && b[indexB] == '\0' )
return 0;
else
return -1;
}
Example in Ideone tested.