uli / dragonbasic

Dragon BASIC compiler for Game Boy Advance
Other
42 stars 7 forks source link

Setting a string to be empty causes MF to generate a segmentation fault. #5

Closed supercom32 closed 1 year ago

supercom32 commented 6 years ago

Issue found using the latest version of Dragon Basic under Linux (Commit ID: d2ce042366068083a5fe3089873a22221fffbc26)

Setting a string to be empty (Ie. "") causes MF to generate a segmentation fault. This functionality is important since users may want to append values to a new string, but cannot do so from an empty one since MF does not allow empty strings to be defined. One example of this kind of use is padding a string with spaces to centre text with equal spaces on ether side of it. This bug is likely related to the issue "Checking the condition of a string to be empty causes MF to generate a segmentation fault." (https://github.com/uli/dragonbasic/issues/4)

Partial workaround: Figure out what the first character of your string is and initialise it with that value instead of (""). This works for tasks like padding strings, but does not help when you want to make a string appear uninitialised, or truly empty with no value.

uli commented 1 year ago

Should be fixed now. Sorry for the delay.

uli commented 1 year ago

closing