It is not clear whether the format string "%[\0a]" matches the input string "a" or not.  I interpret the documentation as saying that once the selector "%[ " has been opened, the format interpreter must find a matching "]", therefore it must not interpret the embedded "\0" as the end of the format string. However, trying to use such a format string causes the compiler to report the warning "format contains NUL", which suggests that using such a format string involves undefined behaviour.

Reply via email to