bmx-ng / text.mod

Text Utilities
0 stars 3 forks source link

[Text.Ini] Random characters appended #18

Closed thareh closed 1 year ago

thareh commented 1 year ago

Good day,

This seems to produce some random characters at the end of the last property value.

Framework BRL.Blitz
Import BRL.StandardIO
Import Text.Ini

For Local i:Int = 0 Until 20
    Local ini:TIni = TIni.Load("Config.ini")

    For Local a:Int = 0 Until ini.CountSections()

        Local s:TIniSection = ini.GetSection(a)

        Print s.GetName()

        For Local b:Int = 0 Until s.CountProperties()

            Local p:TIniProperty = s.GetProperty(b)

            Print p.GetName() + ": " + p.GetValue()

        Next

    Next
Next

Config.ini

[mysql]
user = "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"

The config file seems to be exactly 64 bytes which may give an indication to what's wrong, like an array out of bounds or similar.

Thanks!

GWRon commented 1 year ago

When I save this file on linux it is 62 bytes. I appended 2 spaces at the end to have 64 bytes.

-> both result in a "as expected" output

Same happens if I let it end with newlines (so \n instead of " ").

Saving it with Windows line endings the file is 66 bytes for me - and works as it should. Maybe zip your config.ini and upload it so we get your file to test.

./bmk makeapp -g x64 -t console -quick -r -x "/home/ronny/Arbeit/Projekte/Testcodes/NG/text.mod/test.bmx" (in directory: /home/ronny/Arbeit/Tools/BlitzMaxNG/bin)
Executing:test
Compilation finished successfully.
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"
mysql
user : "root"
pass = "iAcVqmjzXTTUaQhD"
port = "3306"

PS: change your password :)

thareh commented 1 year ago

Ah yes, you're most right.

Here's the file.

The password was generated specifically for this, so no worries 😄

Thanks!

thareh commented 1 year ago

Looke like something is funky with your output above as well, user is with : but the others are with = so it probably only accepts the type if line break (CR LF) I have in my file.