base: String constructor for different lengths
Let the copy constructor compile for different CAPACITYs of the String<CAPACITY> class. Fix #2085
This commit is contained in:
parent
929ca5c163
commit
e7d5b34fc5
|
@ -630,9 +630,9 @@ class Genode::String
|
||||||
* Copy constructor
|
* Copy constructor
|
||||||
*/
|
*/
|
||||||
template <unsigned N>
|
template <unsigned N>
|
||||||
String(String<N> const &other) : _len(min(other._len, CAPACITY))
|
String(String<N> const &other) : _len(min(other.length(), CAPACITY))
|
||||||
{
|
{
|
||||||
Genode::strncpy(_buf, other._buf, _len);
|
Genode::strncpy(_buf, other.string(), _len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user