Good, but I&#x27;d do one modification -- always write a null byte at the end. Otherwise you end up with a non-null-terminated string and that&#x27;s bad.<p>So,<p><pre><code>  copy_sz = src_sz &lt; (dest_sz - dest_off) ? src_sz : (dest_sz - dest_off - 1);
  ...
  *dest_end = &#x27;\0&#x27;;</code></pre>