diff options
Diffstat (limited to 'include/fud_string.hpp')
-rw-r--r-- | include/fud_string.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/fud_string.hpp b/include/fud_string.hpp index 4367aae..ba05450 100644 --- a/include/fud_string.hpp +++ b/include/fud_string.hpp @@ -72,7 +72,7 @@ class String { auto lengthResult = cStringLength(cString); if (lengthResult < 0 || lengthResult >= SSIZE_MAX) { - return StringResult::error(FudStatus::InvalidInput); + return StringResult::error(FudStatus::ArgumentInvalid); } auto stringLength = static_cast<size_t>(lengthResult); if (SIZE_MAX - totalLength < stringLength) { @@ -89,6 +89,7 @@ class String { output.m_allocator = allocator; if (output.m_length >= output.m_capacity) { output.m_capacity = output.m_length + 1; + /* Avoid using compiler expansions in headers */ auto dataResult = output.m_allocator->allocate(output.m_capacity); if (dataResult.isError()) { return StringResult::error(dataResult.getError()); |