Thanks Jörn, I think it is sufficient and best to just silently truncate all names to 255 chars ??? (patch attached). But it is not ideal... the game instance will be misrepresented until the game is reloaded, but db integrity should be ok.
A simple alternative would to throw an error inside AddName, which (after a quick test) results in the name being set to '?' Without a heap of code (there are 36 calls to AddName), i'm not sure we can handle any gui-generated error gracefully ? The error is obviously not a common one. Steven --- src/namebase.cpp (revision 2038) +++ src/namebase.cpp (working copy) @@ -429,7 +429,14 @@ } nameNodeT * node = NULL; - err = Tree[nt]->Insert (str, &node); + if (strlen(str) < 256) { + err = Tree[nt]->Insert (str, &node); + } else { + // Unlikely, but truncate Name if too big + char truncated[256]; + strncpy (truncated, str, 255); + err = Tree[nt]->Insert (truncated, &node); + } if (err != ERROR_Exists) { // Set data for the new node: node->data.id = Header.numNames[nt]; On Fri, Oct 10, 2014 at 1:12 AM, Jörn Behrensen <j.behren...@agentur-focus.de> wrote: > Dear Steven, > > I guess there is a small bug when you enter more than 256 characters > into the "event"-field. After you try to save the database, the program > shows a error-message. > > If you want to reopen this database, the program crashes. Trying to fix > the database with "scidt -N databasename" shows that the database is > corrupted. > > A short GOOGLE search shows a trick to recover the database, however the > information in the name file is lost and maybe some hours of work. > > You can reproduce the error, if you fill the event-filed with 255 > characters, store it and everything is fine. Adding another char and > try to store the game again, the program crashes. > > I hope this helps to improve your wonderfull program. > > Best regards > Joern > > > > ------------------------------------------------------------------------------ > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk > _______________________________________________ > Scidvspc-users mailing list > Scidvspc-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/scidvspc-users
name_too_big_fix.diff.gz
Description: GNU Zip compressed data
------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________ Scidvspc-users mailing list Scidvspc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scidvspc-users