My issue isn&#x27;t that src is or isn&#x27;t NUL terminated (strings in c absolutely must be NUL terminated) its that strlcpy requires a call to strlen (probably inlineable with lto) which is going to be a lot slower than not. Also there is a bug in my &#x27;strmcpy&#x27; in the last for loop it should be n &amp;&amp; *s