m0j0hn / editor-on-fire

Automatically exported from code.google.com/p/editor-on-fire
Other
0 stars 0 forks source link

Use dynamically sized strings for tags structure #218

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is mostly important for dealing with the problem from issue 195 (scores 
corrupted during INI import).  By allowing INI settings to be any length, it 
will allow them to be imported flawlessly, but it will require some additional 
handling in the import routine.

FoFLC's text parsing behavior makes a pre-pass through the file to identify the 
length of the longest line of text, so that a sufficiently large buffer can be 
created.  This buffer has the ability to store any line in the text file, 
making buffer overflows impossible.  Adapting such logic for use in EOF would 
probably be the easiest way to complete this.

For newly-added or edited INI settings, a working buffer would need to be 
created.  After the input is accepted, an appropriately sized permanent buffer 
could be used to keep the setting in.

Original issue reported on code.google.com by raynebc on 16 Dec 2010 at 2:44

GoogleCodeExporter commented 9 years ago
Some tasks for this enhancement:

1. Write a function to perform a Unicode safe duplication of a string, similar 
to the one used in FoFLC.
2. Change the artist, title, frettist, year and loading_text strings to be 
stored as normal char pointers and update the logic to handle them correctly.
3. Change ini_setting[] to be an array of char pointers and update the logic to 
handle them correctly.

When a string is made empty, it should be freed and assigned a value of NULL.

Original comment by raynebc on 18 Dec 2010 at 7:51

GoogleCodeExporter commented 9 years ago
4.  Restore the INI import logic to store scores.

Original comment by raynebc on 18 May 2012 at 6:50