It is currently Sun Sep 22, 2019 3:22 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Bug or my mistake?
PostPosted: Sat Apr 06, 2019 2:58 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Apr 10, 2017 6:17 pm
Posts: 269
Location: Germany
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 :)

_________________
webpage


Top
 Profile  
Reply with quote  
 Post subject: Re: Bug or my mistake?
PostPosted: Sat Apr 06, 2019 3:34 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3401
Your problem with DataSection
Use instead :
Code:
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Bug or my mistake?
PostPosted: Sat Apr 06, 2019 4:36 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Apr 10, 2017 6:17 pm
Posts: 269
Location: Germany
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?

_________________
webpage


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye