<div dir="ltr"><div>Maybe there is also the option of declaring it byte *?</div><div>The convention would be char* <=> Null terminated string, byte* <=> uninterpreted bytes<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 10 juin 2020 à 15:14, Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <div><div id="gmail-m_-3295475754161837209__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">
                                        Hi all,<div><br></div><div>I just found out that you can avoid this automatic interpretation as C string if you use a type alias to char*. This could at least help if an external library forgets the NULL character for that returned char* and makes your VM crash. :-)</div><div><br></div><div>Best,</div><div>Marcel</div><div></div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 10.06.2020 12:35:27 schrieb Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de" target="_blank">marcel.taeumel@hpi.de</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif"><div id="gmail-m_-3295475754161837209__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">Hi all!<div></div><div><br></div><div>The FFI plugin automatically converts "char*" return values into a Smalltalk string when returning from the FFI call.</div><div><br></div><div>I would rather leave this conversion to the image side because you have to do it anyway when interpreting external structures. See ExternalData >> #fromCString. And because it can be dangerous. Note that I do like automatic String-to-char* conversion when making an FFI call. Just not the other way around.</div><div><br></div><div>See (Threaded)FFIPlugin >> #ffiReturnCStringFrom:.</div><div><br></div><div>What are your thoughts on this matter?</div><div><br></div><div>Best,</div><div>Marcel</div></div></div></blockquote>
                                        </div></div></blockquote></div>