mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 10:01:57 +00:00
Let XML generator append a trailing newline
By appending a newline to the generated XML data, we prevent the output from messing with the command prompt when using 'cat' on a shell. Futhermore, when using line-buffered output, the trailing newline ensures that the output gets gets properly flushed.
This commit is contained in:
parent
613d208045
commit
6f167b449c
@ -232,7 +232,10 @@ class Genode::Xml_generator
|
||||
:
|
||||
_out_buffer(dst, dst_len)
|
||||
{
|
||||
if (dst) node(name, func);
|
||||
if (dst) {
|
||||
node(name, func);
|
||||
_out_buffer.append('\n');
|
||||
}
|
||||
}
|
||||
|
||||
template <typename FUNC>
|
||||
|
@ -45,7 +45,7 @@ compare_output_to {
|
||||
[init -> test-xml_generator] </label>
|
||||
[init -> test-xml_generator] </config>
|
||||
[init -> test-xml_generator]
|
||||
[init -> test-xml_generator] used 199 bytes
|
||||
[init -> test-xml_generator] used 200 bytes
|
||||
[init -> test-xml_generator] buffer exceeded (expected error)
|
||||
[init -> test-xml_generator] --- XML generator test finished ---
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ int main(int argc, char **argv)
|
||||
* corresponding run script).
|
||||
*/
|
||||
size_t used = fill_buffer_with_xml(dst, sizeof(dst));
|
||||
printf("result:\n\n%s\n\nused %zd bytes\n", dst, used);
|
||||
printf("result:\n\n%s\nused %zd bytes\n", dst, used);
|
||||
|
||||
/*
|
||||
* Test buffer overflow
|
||||
|
Loading…
x
Reference in New Issue
Block a user