summaryrefslogtreecommitdiff
path: root/source/libfud.cpp
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 /source/libfud.cpp
parentb32e83ece42cec5aa9dee370bcdf349d23dbc8ba (diff)
Rename InvalidInput to ArgumentInvalid.
Diffstat (limited to 'source/libfud.cpp')
-rw-r--r--source/libfud.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/source/libfud.cpp b/source/libfud.cpp
index 538d3a9..802b2c7 100644
--- a/source/libfud.cpp
+++ b/source/libfud.cpp
@@ -37,7 +37,7 @@ FUD fud()
return fudInfo;
}
-Result<String, FudStatus> getEnv(const char* name)
+Result<String, FudStatus> getEnv(const char* name, Allocator* allocator)
{
using RetType = Result<String, FudStatus>;
@@ -50,12 +50,7 @@ Result<String, FudStatus> getEnv(const char* name)
return RetType::error(FudStatus::NotFound);
}
- auto envVarResult = String::makeFromCString(resultString);
- if (envVarResult.isError()) {
- return RetType::error(envVarResult);
- }
-
- return RetType::okay(std::move(envVarResult));
+ return String::makeFromCString(resultString, allocator);
}
} // namespace fud