[Gambas-bugtracker] Bug #1699: Pointers are not written to memory streams correctly when set to null

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Wed Dec 18 08:12:19 CET 2019


Comment #8 by Benoît MINISINI:

Do something like that:

hFile = Open Null For Write
hFile.NullTerminatedString = TRUE
iLen = Seek(hFile)
Close #hFile

MyPointer = Alloc(iLen)
hFile = Open Memory MyPointer For Write
' you can set NullTerminatedString to FALSE in the memory stream instead of setting it to TRUE in the null stream.
' hFile.NullTerminatedString = FALSE
Close #hFile

More information about the Bugtracker mailing list