That's what I thought but
I used a test file with 2 lines with '\n' at the end.
then I used a program that simply print out the line to be sure that '\n' was there.
this code
Code:
int main (int argc, char *argv[]) {
    FILE *stream;
    size_t word=100;
    char *buf;
 
  stream = fopen (argv[1], "r");
 
  if ( (buf = (char *) calloc(word, sizeof(char ))) == NULL){
      printf("error");
    exit(-1);
   }
  
 while (getline(&buf, &word , stream)!=-1) {
      printf("%s\n", buf);
    }
  fclose(stream);
  free(buf);
  return 0;
}
the lines printed are
Code:
example1
           <----empty
example2
            <---empty
so the file definitely has the '\n', but the problem that seems to be not there raise again. So I'm not sure about the fact that is due to the lack of '\n'