title: strcmp says seemingly identical string are not equal
body: <p>I am using <code>strcmp</code> to compare two strings. <code>lhs</code> is coming from a filestream via <code>fgets</code>. <code>rhs</code> is being created generated by a for loop to be a sequence of <code>n-1</code> whitespaces.</p>
  
  <hr>
  
  <h3> Example </h3>
  
  <pre><code>#include &lt;string.h&gt;
  #include &lt;stdio.h&gt;
  
  int main() {
    size_t n = 10;
    char rhs[n];
  
    memset(rhs, ' ', n - 1); // Fill with spaces using memset()
    rhs[n-1] = 0; // Add NUL terminator
  
    printf("len=%zu\n", strlen(rhs));
  
    char lhs[n];
  
    FILE* file = fopen("test", "r");
    fgets(lhs, sizeof(lhs), file);
    printf("read=%s\n", lhs);
  
    return 0;
  }
  </code></pre>
  
  <p><hr>
  When using gdb, I will find that I have two strings that appear identical (I used gdb's <code>print</code> for this):</p>
  
  <p><code>lhs</code> = <code>"   "</code></p>
  
  <p><code>rhs</code> = <code>"   "</code></p>
  
  <p>Yet, <code>strcmp(lhs, rhs) != 0</code>. This should return a <code>0</code> indicating that the strings are identical, but instead I get some other non-zero value.</p>
  
  <p>Why aren't these strings considered equal?</p>