Rewrite length specifier tests without using printf to workaround broken MSVC implementation.