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.
- Bug#1059873: glibc-doc-reference: 12.14.5 String In... Christopher Yeleighton
- Bug#1059873: 12.14.5 String Input Conversions:... Krzysztof Żelechowski
- Bug#1059873: 12.14.5 String Input Conversi... Aurelien Jarno
- Bug#1059873: glibc-doc-reference: 12.14.5 Stri... Aurelien Jarno
- Bug#1059873: 12.14.5 String Input Conversions:... Aurelien Jarno
- Bug#1059873: 12.14.5 String Input Conversions:... Aurelien Jarno
- Bug#1059873: glibc-doc-reference: 12.14.5 Stri... Aurelien Jarno