title: C getline() read last line twice
body: <p>just wondering why my function getline() read the last line twice.</p>
  <p>I'm supposed to read from a tsv file and print each line to stdout. But somehow keep reading the last row twice.</p>
  <pre><code>            char *line = NULL;
              size_t line_buf_size = 0;
              ssize_t line_size;
              line_size = getline(&amp;line, &amp;line_buf_size, stdin);
              int row = 0;
      
              while (line_size &gt;= 0)
              {
                  row++;
                  line_size = getline(&amp;line, &amp;line_buf_size, stdin);
                  printf(&quot;%s&quot;, line);
  </code></pre>
  <p>if a file looks like this</p>
  <pre><code>A B C
  D E F
  </code></pre>
  <p>it prints</p>
  <pre><code>A B C
  D E F
  D E F
  </code></pre>
  <p>How do i fix it?</p>