title: UVa Online Judge ANSI C Runtime Error with scanf but Accepted with gets combined with sscanf
body: <p>I will omit the whole code but these tests so far can be quite disturbing:</p>
  
  <p>This get Accepted with ANSI C, C++ and C++ 11</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  int main()
  {
      int p, q, r, s, t, u;
      char* str = malloc(1000);
      while(gets(str) != NULL) {
          sscanf(str, "%d %d %d %d %d %d", &amp;p, &amp;q, &amp;r, &amp;s, &amp;t, &amp;u);
          printf("%d %d %d %d %d %d\n", p, q, r, s, t, u);
      }
  }
  </code></pre>
  
  <p>The disturbing fact comes now, this code get Runtime Error in ANSI C but Accepted in C++ and C++ 11:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main()
  {
      int p, q, r, s, t, u;
      //== 6 instead of != EOF also gives me a runtime error
      while(scanf("%d %d %d %d %d %d", &amp;p, &amp;q, &amp;r, &amp;s, &amp;t, &amp;u) != EOF) {
          printf("%d %d %d %d %d %d\n", p, q, r, s, t, u);
      }
  }
  </code></pre>