Re: [OpenSmalltalk/opensmalltalk-vm] refactor sqMessageBox to void using toUnicode (4f6f191)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] refactor sqMessageBox to void using toUnicode (4f6f191)

David T Lewis
 

What about the '0' byte in line 127? do we need to calloc one byte more here?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<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":"@krono on 4f6f191: What about the `'0'` byte in line 127? do we need to `calloc` one byte more here?"}],"action":{"name":"View Commit","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4f6f191613f6bf6cdb989b39e1002cf4938f475c#commitcomment-31812308"}}}</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-31812308", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4f6f191613f6bf6cdb989b39e1002cf4938f475c#commitcomment-31812308", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] refactor sqMessageBox to void using toUnicode (4f6f191)

David T Lewis
 

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


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<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>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] refactor sqMessageBox to void using toUnicode (4f6f191)

David T Lewis
In reply to this post by David T Lewis
 

Yay for “standards”


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<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":"@krono on 4f6f191: Yay for “standards”"}],"action":{"name":"View Commit","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4f6f191613f6bf6cdb989b39e1002cf4938f475c#commitcomment-31813128"}}}</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-31813128", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/4f6f191613f6bf6cdb989b39e1002cf4938f475c#commitcomment-31813128", "name": "View Commit" }, "description": "View this Commit on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>