The trick would seem to be dealing with the lack of a comma after the last word.
So maybe something like
The %*c will eat a comma (or indeed any other character), if there happens to be one.Code:while ( (fscanf(pRead, "\"%[^\"]\"%*c", buffer) == 1 )
But it won't cause a scan failure at the end of input because it's missing.