mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01: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:
committed by
Christian Helmuth
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user