You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const auto insertResult = fmt::format_to_n(std::back_inserter(test), 4, "{}", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua");
The text was updated successfully, but these errors were encountered:
TheAnswer
changed the title
broken format_to_n in MSVC Version 16.7.7 not respecting smax ize
broken format_to_n in MSVC Version 16.7.7 not respecting max size
Nov 12, 2020
TheAnswer
changed the title
broken format_to_n in MSVC Version 16.7.7 not respecting max size
broken format_to_n not respecting max size
Nov 12, 2020
TheAnswer
changed the title
broken format_to_n not respecting max size
format_to_n not respecting max size
Nov 12, 2020
#include <iostream>
#include <fmt/format.h>
int main()
{
std::vector<char> test;
const auto insertResult = fmt::format_to_n(std::back_inserter(test), 4, "{}", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua");
std::cout << test.size() << " " << insertResult.size << std::endl;
return 0;
}
The above code hangs or if it succeeds, and you use a static sized buffer it will write over the max size corrupting the buffer.
This behaviour started with fmt 7.1.0, versions below that work fine.
Experiencing this issue in MSVC Version 16.7.7 and gcc 8.1
https://godbolt.org/z/eGEM9s
Program returned: 143
Killed - processing time exceeded
Works fine with fmt 7.0.0
https://godbolt.org/z/1MzY4Y
The text was updated successfully, but these errors were encountered: