mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-16 00:46:03 +08:00
Fixed make_string sizes
This commit is contained in:
parent
a5ee0bb24c
commit
f689f32259
@ -477,7 +477,7 @@ namespace etl
|
||||
template<size_t ARRAY_SIZE>
|
||||
etl::string<ARRAY_SIZE - 1> make_string(const char(&text)[ARRAY_SIZE])
|
||||
{
|
||||
return etl::string<ARRAY_SIZE - 1>(text, ARRAY_SIZE - 1);
|
||||
return etl::string<ARRAY_SIZE - 1>(text, etl::strlen(text));
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@ -486,7 +486,7 @@ namespace etl
|
||||
template<const size_t MAX_SIZE, const size_t SIZE>
|
||||
etl::string<MAX_SIZE> make_string_with_capacity(const char(&text)[SIZE])
|
||||
{
|
||||
return etl::string<MAX_SIZE>(text, SIZE - 1);
|
||||
return etl::string<MAX_SIZE>(text, etl::strlen(text));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -460,7 +460,7 @@ namespace etl
|
||||
template<size_t ARRAY_SIZE>
|
||||
etl::u16string<ARRAY_SIZE == 1 ? 1 : ARRAY_SIZE - 1> make_string(const char16_t(&text)[ARRAY_SIZE])
|
||||
{
|
||||
return etl::u16string<ARRAY_SIZE == 1 ? 1 : ARRAY_SIZE - 1>(text, ARRAY_SIZE - 1);
|
||||
return etl::u16string<ARRAY_SIZE == 1 ? 1 : ARRAY_SIZE - 1>(text, etl::strlen(text));
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@ -469,7 +469,7 @@ namespace etl
|
||||
template<const size_t MAX_SIZE, const size_t SIZE>
|
||||
etl::u16string<MAX_SIZE> make_string_with_capacity(const char16_t(&text)[SIZE])
|
||||
{
|
||||
return etl::u16string<MAX_SIZE>(text, SIZE - 1);
|
||||
return etl::u16string<MAX_SIZE>(text, etl::strlen(text));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -460,7 +460,7 @@ namespace etl
|
||||
template<size_t ARRAY_SIZE>
|
||||
etl::u32string<ARRAY_SIZE == 1 ? 1 : ARRAY_SIZE - 1> make_string(const char32_t(&text)[ARRAY_SIZE])
|
||||
{
|
||||
return etl::u32string<ARRAY_SIZE == 1 ? 1 : ARRAY_SIZE - 1>(text, ARRAY_SIZE - 1);
|
||||
return etl::u32string<ARRAY_SIZE == 1 ? 1 : ARRAY_SIZE - 1>(text, etl::strlen(text));
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@ -469,7 +469,7 @@ namespace etl
|
||||
template<const size_t MAX_SIZE, const size_t SIZE>
|
||||
etl::u32string<MAX_SIZE> make_string_with_capacity(const char32_t(&text)[SIZE])
|
||||
{
|
||||
return etl::u32string<MAX_SIZE>(text, SIZE - 1);
|
||||
return etl::u32string<MAX_SIZE>(text, etl::strlen(text));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -460,7 +460,7 @@ namespace etl
|
||||
template<size_t ARRAY_SIZE>
|
||||
etl::wstring<ARRAY_SIZE == 1 ? 1 : ARRAY_SIZE - 1> make_string(const wchar_t(&text)[ARRAY_SIZE])
|
||||
{
|
||||
return etl::wstring<ARRAY_SIZE == 1 ? 1 : ARRAY_SIZE - 1>(text, ARRAY_SIZE - 1);
|
||||
return etl::wstring<ARRAY_SIZE == 1 ? 1 : ARRAY_SIZE - 1>(text, etl::strlen(text));
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
@ -469,7 +469,7 @@ namespace etl
|
||||
template<const size_t MAX_SIZE, const size_t SIZE>
|
||||
etl::wstring<MAX_SIZE> make_string_with_capacity(const wchar_t(&text)[SIZE])
|
||||
{
|
||||
return etl::wstring<MAX_SIZE>(text, SIZE - 1);
|
||||
return etl::wstring<MAX_SIZE>(text, etl::strlen(text));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user