aboutsummaryrefslogtreecommitdiff
path: root/cpp05/ex02/ShrubberyCreationForm.cpp
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-12-12 12:46:18 +0100
committerCharles Cabergs <me@cacharle.xyz>2020-12-12 12:46:59 +0100
commitd2d136a5810b8dc233b7a6260531e7fd0c138f3e (patch)
tree3a812a1aaeda50a6b6738a079997cdcd5a7b7ab2 /cpp05/ex02/ShrubberyCreationForm.cpp
parent0071b1e944cbce91ff6ff8e235280c3955ce1d5b (diff)
downloadpiscine_cpp-d2d136a5810b8dc233b7a6260531e7fd0c138f3e.tar.gz
piscine_cpp-d2d136a5810b8dc233b7a6260531e7fd0c138f3e.tar.bz2
piscine_cpp-d2d136a5810b8dc233b7a6260531e7fd0c138f3e.zip
Fixing compilation error on linux VM
Diffstat (limited to 'cpp05/ex02/ShrubberyCreationForm.cpp')
-rw-r--r--cpp05/ex02/ShrubberyCreationForm.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/cpp05/ex02/ShrubberyCreationForm.cpp b/cpp05/ex02/ShrubberyCreationForm.cpp
index 262f166..ac76272 100644
--- a/cpp05/ex02/ShrubberyCreationForm.cpp
+++ b/cpp05/ex02/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:45:12 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 <<