sscanf(line, "%d %64[^\n", &seconds, message);
does %64[^ mean - up to 64 characters? Should it work with GNU C Compiler?
It means "read at most 64 characters or stop when reaching a newline, whichever comes first". It's specified by the standard so all standard libraries have to support it.
C11 7.21.6.2
[
Matches a nonempty sequence of characters from a set of expected characters (the scanset). [...] The conversion specifier includes all subsequent characters in the format string, up to and including the matching right bracket (]).The characters between the brackets (the scanlist) compose the scanset, unless the character after the left bracket is a circumflex (^), in which case the scanset contains all characters that do not appear in the scanlist between the circumflex and the right bracket.
As noted in the comments, a matching ]
is probably required to delimit the scanlist. An s
specifier is not required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With