mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 20:05:54 +00:00
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
|
||||
*/
|
||||
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…
x
Reference in New Issue
Block a user