Repository navigation
Conversation
XMLTag::value(std::vector<std::string>&) kept the spaces after each comma, so a PartList written as "Part1, Part2" looked for a part named " Part2" and the model failed with "Failed building parts." The items are now trimmed, which also drops the 256-character buffer the items were copied into. Closes febiosoftware#137
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #137
XMLTag::value(std::vector<std::string>&)(and the overload that takes a count) split the tag value at commas but kept the whitespace around each item.<PartList>is the only place that reads a string list this way. A list written asPart1, Part2asked for a part namedPart2,FEBModel::BuildPartcouldn't find that domain, and the model stopped with "Failed building parts."Both overloads now take each item through a small
listItemhelper that trims spaces, tabs and line breaks around it. Spaces inside a name are kept. The helper builds astd::string, so items are no longer copied through the fixedchar tmp[256]buffer, which overflowed for a name longer than 255 characters.Testing
I didn't build all of FEBio or run a contact model. I compiled
FECore/XMLReader.cppwith a small program (g++ 14,-std=c++17) that reads a<PartList>throughXMLReader::OpenStringand checks both overloads:With this change:
On
develop:Note: I used Claude Code while working on this.