title: fscanf with while loop resulting in double reads per line
body: <p>I'm having some trouble getting fscanf to work properly when reading a text file. </p>
  
  <p>My text file is (there are [spaces] in front of every letter): </p>
  
  <pre><code> L 10,4 
   S 18,4
   L 20,4
   S 28,4
   S 50,4
  </code></pre>
  
  <p>What I want to do is read each line and store the values into some memory. Right now, however, I just want to solve this issue I'm having when using the while loop- I'm getting two outputs per line essentially, and I can't figure out why.</p>
  
  <p>Here is my code: </p>
  
  <pre><code>FILE *tFile = fopen(tracefile, "r");
  int address, size;
  char operation;
  char comma;
  printf("START \n");
  while(fscanf(tFile, "%c %x %c %d", &amp;operation, &amp;address, &amp;comma, &amp;size) &gt; 0){
      printf("O: %c", operation); 
      printf("\n");
      printf("A: %x", address); 
      printf("\n");
      printf("C: %c", comma); 
      printf("\n");
      printf("S: %d", size); 
      printf("\n");
  
  }
  printf("END \n");
  fclose(tFile);
  </code></pre>
  
  <p>Lastly, my output is </p>
  
  <pre><code>START
  O:
  A: 0
  C:
  S: 4195731
  O: L
  A: 10
  C: ,
  S: 4
  O:
  A: 10
  C: ,
  S: 4
  O: S
  A: 18
  C: ,
  S: 4
  O:
  
  A: 18
  C: ,
  S: 4
  O: L
  A: 20
  C: ,
  S: 4
  O:
  
  A: 20
  C: ,
  S: 4
  O: S
  A: 28
  C: ,
  S: 4
  O:
  
  A: 28
  C: ,
  S: 4
  O: S
  A: 50
  C: ,
  S: 4
  O:
  
  A: 50
  C: ,
  S: 4
  END
  </code></pre>
  
  <p>Thanks for any help.</p>