title: What is the best alternative to strncpy()?
body: <p>The function <code>strncpy()</code> doesn't always null terminate so I want to know what is the best alternative that always null terminates?
  I want a function that if:</p>
  
  <pre><code>strlen(src) &gt;= n /*n is the number of characters to be copied from source*/
  </code></pre>
  
  <p>there's no need to add further code like this: </p>
  
  <pre><code>buf[sizeof(buf)-1] = 0; 
  </code></pre>