<p>You're right!<br>
<a href="https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l?view=vs-2017" rel="nofollow">https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l?view=vs-2017</a><br>
<code>vsnprintf</code> always writes the NULL terminator, and we can pass <code>count=sizeof(buffer)</code> as C99 mandates.<br>
<code>_vsnprintf</code> does not, so we must set the buffer to zero, and pass <code>count=sizeof(buffer)-1</code>.<br>
The Microsoft specific API is much too complex!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4f6f191613f6bf6cdb989b39e1002cf4938f475c#commitcomment-31812755">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW_4qbqHIbQdhPJ195USFiQybx2YWks5u-3MXgaJpZM4Zl12_">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyW68fdVj0TxkBOAnLHoclZS08Q-SZks5u-3MXgaJpZM4Zl12_.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@nicolas-cellier-aka-nice on 4f6f191: You're right!\r\nhttps://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l?view=vs-2017\r\n`vsnprintf` always writes the NULL terminator, and we can pass `count=sizeof(buffer)` as C99 mandates.\r\n`_vsnprintf` does not, so we must set the buffer to zero, and pass `count=sizeof(buffer)-1`.\r\nThe Microsoft specific API is much too complex!"}],"action":{"name":"View Commit","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4f6f191613f6bf6cdb989b39e1002cf4938f475c#commitcomment-31812755"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4f6f191613f6bf6cdb989b39e1002cf4938f475c#commitcomment-31812755",
"url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4f6f191613f6bf6cdb989b39e1002cf4938f475c#commitcomment-31812755",
"name": "View Commit"
},
"description": "View this Commit on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>