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:
Stefan Kalkowski 2016-09-05 10:49:39 +02:00 committed by Christian Helmuth
parent 929ca5c163
commit e7d5b34fc5

View File

@ -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);
}
/**