title: Variadic function does not pass the first argument correctly
body: <p>I have used variadic functions to wrap <code>printf</code> (or <code>vprintf</code>).</p>
  
  <p>The following code works except for making mistake on the first variadic argument to <code>warning_printf</code>. Also, placing the string directly will change the ASCII character but it does not fix it as the message is still random.</p>
  
  <p>What it prints is</p>
  
  <pre><code>[Warning]
            ®¯$ address: 0x87afae8a
  </code></pre>
  
  <p>Instead of</p>
  
  <pre><code>[Warning] Failed to initialize setting address: 0x87afae8a
  </code></pre>
  
  <p>Where the word Warning is colored properly (anyway it does not matter). But the <code>msg_warn</code> seems not being passed correctly. I tested adding more variables to this function. They all work fine except for only the first variadic argument <code>msg_warn</code>.</p>
  
  <p>What is wrong with my code?</p>
  
  <pre><code>void colorful_printf( const char* header, const char* color, const char* fmt, ... )
  {
      printf("[%s%s%s] ", color, header, RESET_ANSI_COLOR);
      va_list args;
      va_start( args, fmt );
      vprintf(fmt, args);
      va_end( args );
  }
  
  
  void warning_printf( const char* fmt, ... )
  {
      va_list args;
      va_start( args, fmt );
      colorful_printf("Warning", WARNING_COLOR, fmt, args);
      va_end( args );
  }
  
  
  char msg_warn[] = "Failed to initialize setting";
  warning_printf( "%s address: 0x%2x", msg_warn, address );
  </code></pre>
  
  <p>Online compiler: <a href="https://onlinegdb.com/rkHTpU6tE" rel="nofollow noreferrer">link</a></p>