title: Bad behavior with printf and multiple strings
body: <p>When I use printf/printf_s with two strings, I get the same output for both %s vars.</p>
  
  <pre><code>IN_ADDR oldIP;
  oldIP.S_un.S_addr = iptable[j]-&gt;ipAddress;
  IN_ADDR newIP;
  newIP.S_un.S_addr = adapterTbl-&gt;table[i].dwAddr;
  printf_s("index %d old: %s new: %s", 
            adapterTbl-&gt;table[i].dwIndex, inet_ntoa(oldIP),
             inet_ntoa(newIP));
  </code></pre>
  
  <p>Output is: </p>
  
  <pre><code>index 11 old: 192.168.1.1 new: 192.168.1.1
  </code></pre>
  
  <p>Now, I have checked that the values of oldip and newip are different by breaking before the print statement, and I have also tried to make the following function and use it in the print statement (instead of inet_ntoa):</p>
  
  <pre><code>char *convertIP (DWORD ip)  
  {  
      IN_ADDR *addr = new IN_ADDR;
      memset(addr, 0, sizeof(IN_ADDR));
      addr-&gt;S_un.S_addr = (u_long) ip;
      return inet_ntoa(*addr);
  } 
  </code></pre>
  
  <p>The output with this was:</p>
  
  <pre><code>192.168.1.1
  192.168.1.2
  index 11 old: 192.168.1.1 new: 192.168.1.1
  </code></pre>
  
  <p>Why am I seeing this behavior, and how can I fix it?<br>
  Thanks :)</p>