diff options
Diffstat (limited to 'cpp05/ex03/ShrubberyCreationForm.cpp')
| -rw-r--r-- | cpp05/ex03/ShrubberyCreationForm.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp05/ex03/ShrubberyCreationForm.cpp b/cpp05/ex03/ShrubberyCreationForm.cpp index 262f166..3ad872c 100644 --- a/cpp05/ex03/ShrubberyCreationForm.cpp +++ b/cpp05/ex03/ShrubberyCreationForm.cpp @@ -6,7 +6,7 @@ /* By: cacharle <me@cacharle.xyz> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/10/19 13:45:45 by cacharle #+# #+# */ -/* Updated: 2020/11/17 17:15:43 by charles ### ########.fr */ +/* Updated: 2020/12/12 12:44:47 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,10 +29,11 @@ ShrubberyCreationForm::~ShrubberyCreationForm() {} void ShrubberyCreationForm::executeUnsafe() const { - std::ofstream file(m_target + "_shrubbery"); + std::string filename(m_target + "_shrubbery"); + std::ofstream file(filename.c_str()); if (!file.is_open()) { - std::cerr << "Error: " << m_target + "_shrubbery" << ": " << std::strerror(errno) << std::endl; + std::cerr << "Error: " << filename << ": " << std::strerror(errno) << std::endl; return; } file << |
