forked from genodelabs/genode
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Xml_generator: fix and test missing '\0'
Previously, a '\0' was appended to the out buffer at the end of each call of the Node constructor. At the end of the Xml_generator constructor, at the other hand, '\n' was appended. Without exceptions in the Node constructor this led to "\0\n" at the end of generated XML. However, with exceptions, the '\0' of the last Node constructor call was sometimes overwritten, leading to a mere "\n" at the end. It is better to append '\0' only in one place, namely at the point where the '\n' was appended in the Xml_generator constructor. This also fixes the problem with the exceptions. This also extends the xml_generator test to drive a harder test on exceptions in the Xml_generator. Fixes genodelabs#2967
- Loading branch information
Showing
3 changed files
with
126 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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