Bug or my mistake?

Windows specific forum
Bitblazer
Enthusiast
Enthusiast
Posts: 736
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Bug or my mistake?

Post by Bitblazer »

The following source was created by a tool i wrote. When i try to compile it with the windows 5.70 x86 or x64 LTS version, the compiler crashes with a request to report it as a bug. Can somebody verify it to see if it happens with their compiler version too or if i made a mistake?

EncodeProblem.pb

The tool encoded and created smaller files successfully.

Thanks in advance and have a happy weekend :)
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4663
Joined: Sun Apr 12, 2009 6:27 am

Re: Bug or my mistake?

Post by RASHAD »

Your problem with DataSection
Use instead :

Code: Select all

DataMessage.s = "SVRTRgMAAABgAAAAAQAAAF......."
DataMessage.s + "AAAAAAAAAAAAAA......................"
....
....

FileName$ = "winmessage.chm"

*DecodeBuffer = UTF8(DataMessage.s)
Encoded$ = Base64Encoder(*DecodeBuffer, MemorySize(*DecodeBuffer))
Debug "Encoded: " + Encoded$
count = MemorySize(*DecodeBuffer)
*DecodedBuffer = AllocateMemory(count)
Base64Decoder(Encoded$, *DecodedBuffer, count)
Debug "Decoded: " + PeekS(*DecodedBuffer, -1, #PB_UTF8)
Egypt my love
Bitblazer
Enthusiast
Enthusiast
Posts: 736
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Bug or my mistake?

Post by Bitblazer »

Thanks, i rewrote it into using a string variable instead of the datasection as it is cleaner and works fine. But the compiler should'nt crash with the other method using a datasection. So it seems like that method triggered a bug?
Post Reply