title: C copying to a string created from malloc
body: <p>I have this code:</p>
  
  <pre><code>char *name = malloc(strlen(args[1]) + 6);
  strncpy(name, args[1], strlen(args[1]));
  printf("%d\n", strlen(name));
  </code></pre>
  
  <p>Let's say <code>args[1]</code> is "hello" and so <code>strlen(args[1])</code> is 5.
  After malloccing 11 bytes, I then copy 5 bytes of "Hello" (meaning I want to exclude the null terminating byte) to name.</p>
  
  <p>But <code>strlen(name)</code> isn't 5. I get 8. Shouldn't it be 5 since you that's what you copied over?</p>