Actually, I had to repost.
The little asterisk trick doesn't seem to work with brackets, so just use the number that BUFSIZ equals.Code:int foo, bar; char string[BUFSIZ], matchme="10,4,\"Foo'd up beyond all repair\",h\n"; sscanf(matchme, "%d,%d,%512[^\n]", &foo, &bar, string); printf("%d %d %s\n", foo, bar, string);
EDIT: OK, did it again. I mistyped the nul character. Sorry. That really does work, if you don't want to read to a flag character instead.