title: Why have i++; i--; right after each other?
body: <p>I was looking at the source code for <a href="https://en.wikipedia.org/wiki/Nmap" rel="noreferrer">nmap</a> that was released in 1997 and I noticed this section of code that looks a little odd to me:</p>
  
  <pre><code>int i=0, j=0,start,end;
  char *expr = strdup(origexpr);
  ports = safe_malloc(65536 * sizeof(short));
  i++;                                         /* &lt;&lt;&lt;&lt;&lt;&lt; */
  i--;                                         /* &lt;&lt;&lt;&lt;&lt;&lt; */
  for(;j &lt; exlen; j++) 
    if (expr[j] != ' ') expr[i++] = expr[j]; 
  expr[i] = '\0';
  </code></pre>
  
  <p>Why would you have <code>i++;</code> and then <code>i--;</code> right after each other? <code>i</code> is <code>0</code>, then <code>i++</code> turns <code>i</code> to <code>1</code>. After that, <code>i--</code> turns <code>i</code> to <code>0</code>.</p>
  
  <p><a href="https://nmap.org/p51-11.html" rel="noreferrer">Link to original source code.</a> Search for:</p>
  
  <pre><code>i++;
  i--;
  </code></pre>
  
  <p>Can anyone explain what this is for?</p>