How do I parse out the fields in a comma separated string using sscanf while supporting empty fields?
If you use strtok
with the comma as your separator character you'll get a list of strings one or more of which will be null/zero length.
Have a look at my answer here for more information.
man sscanf:
[
Matches a nonempty sequence of characters from the specified set of accepted characters;
(emphasis added).