prova con
codice:
while( strncmp( s, "fine", 4) != 0 );