Fix String(Hex()) usage

- additional add test casye to log.run

Fixes #2265
This commit is contained in:
Alexander Boettcher 2017-01-30 21:35:01 +01:00 committed by Norman Feske
parent 818795ab90
commit dd5592cc50
3 changed files with 5 additions and 1 deletions

View File

@ -592,7 +592,7 @@ class Genode::String
void out_string(char const *str, size_t n) override
{
while (n-- > 0 && _capacity_left())
while (n-- > 0 && _capacity_left() && *str)
_append(*str++);
}
};

View File

@ -36,5 +36,6 @@ compare_output_to {
[init -> test-log] negative hex char: 0xfe
[init -> test-log] positive hex char: 0x02
[init -> test-log] multiarg string: "parent -> child.7"
[init -> test-log] String(Hex(3)): 0x3
[init -> test-log] Test done.
}

View File

@ -30,5 +30,8 @@ void Component::construct(Genode::Env &env)
typedef String<128> Label;
log("multiarg string: ", Label(Char('"'), "parent -> child.", 7, Char('"')));
String<32> hex(Hex(3));
log("String(Hex(3)): ", hex);
log("Test done.");
}