We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code causes a segmentation fault:
fmt::ostream temp_file = fmt::output_file("file.txt"); fmt::ostream move_constructed(std::move(temp_file)); move_constructed.print("Hello world"); //SIGSEGV - Segmentation fault
This is because the internal buffer pointer and data is left uninitialised and left pointing to null.
The following change to fmt::ostream::ostream(ostream&& ) solves this issue
ostream(ostream&& other) : file_(std::move(other.file_)) { set(other.data(), other.capacity()); //Added - Initialises the data other.set(nullptr, 0); }
The text was updated successfully, but these errors were encountered:
Could you submit a PR?
Sorry, something went wrong.
Fix move constructor (#1844)
46f8742
6cccdc2
Fixed in 6cccdc2. Thanks for catching this.
No branches or pull requests
The following code causes a segmentation fault:
This is because the internal buffer pointer and data is left uninitialised and left pointing to null.
The following change to fmt::ostream::ostream(ostream&& ) solves this issue
The text was updated successfully, but these errors were encountered: