title: ofstream, duplicated values
body: <p>values on the output are duplicated</p>
  <p>CODE:</p>
  <pre><code>enum class status_t
      {
          _success,
      };
  
      const char* set_status(status_t status)
      {
         switch(status)
         {
         case status_t::_success: return xorstr_(&quot;[SUCCESS]&quot;);
         }
      }
  
      enum class action_t
      {
          _launch,
      };
  
      const char* set_action(action_t action)
      {
         switch (action)
         {
         case action_t::_launch: return xorstr_(&quot;[LAUNCH]&quot;);
         }
      
      }
  
      void record(const char* status, const char* action, char* message)
      {
         const char* directory = &quot;C:\\log.txt&quot;;
         std::ofstream out(directory, std::ios_base::out | std::ios_base::app);
         out &lt;&lt; status &lt;&lt; char(0x20) &lt;&lt; action &lt;&lt; char(0x20) &lt;&lt; message &lt;&lt; '\n';
         out.close();
      }
  
      int main()
      {
        record(set_status(status_t::_success), set_action(action_t::_launch), &quot;success&quot;);
      }
  </code></pre>
  <p>output: [SUCCESS] [SUCCESS] success</p>
  <p>what can cause such an unusual problem?
  I do not know what stackoverflow wants me to write here, enough to understand the problem</p>