title: fscanf - how to process two floats + whitespace + newline?
body: <p>Using fscanf I want to process text that contains two floats, an arbitrary amount of whitespace before, between, or after the floats (including newlines/returns), and a newline character at the very end. If there are more/fewer than two numbers, then I want to detect that and report an error.</p>
  
  <p>This seems to work for handling the whitespace, but it won't detect if there's more than two floats present:</p>
  
  <pre><code>fscanf(f, "%f %f", &amp;sx, &amp;sy);
  </code></pre>
  
  <p>And this seems to work just as well:</p>
  
  <pre><code>fscanf(f, "%f %f%*[ \n\t\r\f\v]\n", &amp;sx, &amp;sy);
  </code></pre>
  
  <p>Is there a better way to handle this?</p>