summaryrefslogtreecommitdiff
path: root/include/fud_string.hpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-10-17 19:42:29 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-10-17 19:42:29 -0500
commit8249b28bea29e8ce17eac12776a60ec3f9e47176 (patch)
tree98318d7564b5f618cfb59e23cc6b918fcab88ee8 /include/fud_string.hpp
parentb32e83ece42cec5aa9dee370bcdf349d23dbc8ba (diff)
Rename InvalidInput to ArgumentInvalid.
Diffstat (limited to 'include/fud_string.hpp')
-rw-r--r--include/fud_string.hpp3
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());