title: Can I call sscanf mutliple times on the same string?
body: <p>I'm trying to read a line from a file, I grab a line <code>line</code> using <code>fgets</code>. I then try to use <code>sscanf</code> to parse it. Sometimes I'll call <code>sscanf</code> and find out it returns the wrong number of arguments. So then I'll try reparse the same <code>line</code> string. Sometimes it works, sometimes it doesn't (which is leading me to believe that the problem isn't <code>sscanf</code> but something else in my code). Here's an example of what I mean:</p>
  
  <pre><code>i = sscanf(line,"%d/%d/%d %d/%d/%d %d/%d/%d %d/%d/%d\n", &amp;faceV1, &amp;faceUV1, &amp;faceN1, &amp;faceV2, &amp;faceUV2, &amp;faceN2, &amp;faceV3, &amp;faceUV3, &amp;faceN3,
                  &amp;faceV4, &amp;faceUV4, &amp;faceN4);
  
  if(i == 12) {
      //We gotta quad...
      printf("Model.c: Quads not supported\n");
  } else if(sscanf(line,"%d/%d/%d %d/%d/%d %d/%d/%d\n", &amp;faceV1, &amp;faceUV1, &amp;faceN1, &amp;faceV2, &amp;faceUV2, &amp;faceN2, &amp;faceV3, &amp;faceUV3, &amp;faceN3) == 9) {
      //Doesn't do what I expect!
      ...
  </code></pre>
  
  <p>However if I get rid of <code>i = sscanf...</code> and the check for <code>i == 12</code> and go straight to <code>if(sscanf(line,"%d/%d/%d %d/%d/%d %d/%d/%d\n", &amp;faceV1, &amp;faceUV1, &amp;faceN1, &amp;faceV2, &amp;faceUV2, &amp;faceN2, &amp;faceV3, &amp;faceUV3, &amp;faceN3) == 9)</code> it will work as expected. </p>
  
  <p>So back to the title of this question, can I call <code>sccanf</code> multiple times on the same string? Am I calling it wrong? Or should I look elsewhere in my code for the problem?</p>