To add, notably this:<p>_snprintf, _snprintf_l, _snwprintf, _snwprintf_l -&gt; <a href="https:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;2ts7cx93.aspx" rel="nofollow">https:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;2ts7cx93.aspx</a><p><pre><code>  &quot;If len &gt; count, count characters are stored in buffer, no null-terminator is appended, and a negative value is returned.&quot;
</code></pre>
Uh, what?<p>I guess that&#x27;s why it is _snprintf and not snprintf, huh?<p>They do provide secure [1] versions too, but you need to be careful which one you pick. Those secure versions terminate execution in some cases if buffer length is exceeded.<p>[1]: <a href="https:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;f30dzcf6.aspx" rel="nofollow">https:&#x2F;&#x2F;msdn.microsoft.com&#x2F;en-us&#x2F;library&#x2F;f30dzcf6.aspx</a> - better remember that _TRUNCATE flag.