Quote:
A directive is one of the following:
•
A sequence of white-space characters (space, tab, newline, etc.; see isspace(3)). This directive matches any amount of white space, including none, in the input.
• An ordinary character (i.e., one other than white space or '%'). This character must exactly match the next character of input.
That first bullet is the reason that adding the space reads your new line from the buffer. Quote:
c
Matches a sequence of characters whose length is specified by the maximum field width (default 1); the next pointer must be a pointer to char, and there must be enough room for all the characters (no terminating null byte is added). The usual skip of leading white space is suppressed. To skip white space first, use an explicit space in the format.
Jim