title: Weird value and overriding text on variadics
body: <p>I'm trying to create a logging system where you push a log string into a vector and then print all the logs by looping through the vector, but there seems to be an issue where the strings inside my vector are getting replaced by the most recent string pushed, as well as weird characters being added.</p>
  <pre><code>struct color {
      color(unsigned int nr, unsigned int ng, unsigned int nb, unsigned int na) : r(nr), g(ng), b(nb), a(na) {}
      unsigned int r, g, b, a;
  };
  
  struct info {
      const char* text;
      float time;
      color col;
      info(const char* ntext, float ntime, color ncol) : text(ntext), time(ntime), col(ncol) { }
  };
  
  class event_logger {
  public:
      std::vector&lt;info&gt; info_list;
      
      void add_log_messasge(color col, const char* message, ...) {
  
          char fmsg[512] = { '\0' };
          va_list list;
          va_start(list, message);
              vsprintf_s(fmsg, 512, message, list);
          va_end(list);
  
          this-&gt;info_list.push_back(info(fmsg, 10.0f, col));
  
          // limit to 12 messages at a time
          if (this-&gt;info_list.size() &gt; 12)
              this-&gt;info_list.pop_back();
      }
  
      void print_log_info() {
          /* Don't run if the vector is empty. */
          if (!info_list.empty())
          {
              for (size_t i = 0; i &lt; info_list.size(); i++)
              {
                  printf_s(&quot;%s\n&quot;, info_list[i].text);
              }
          }
      }
  };
  
  int main() {
      event_logger log;
      log.add_log_messasge(color(255, 255, 255, 255), &quot;welcome (%.3f, %s)&quot;, 3.14f, &quot;WHAT THE FUCK&quot;);
      log.add_log_messasge(color(255, 255, 255, 255), &quot;unlucky %s&quot;, &quot;dude&quot;);
      log.print_log_info();
  }
  </code></pre>
  <p>Does anyone know what the problem is?</p>