diff options
Diffstat (limited to 'source/libfud.cpp')
-rw-r--r-- | source/libfud.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/libfud.cpp b/source/libfud.cpp index 8c962ba..cec544d 100644 --- a/source/libfud.cpp +++ b/source/libfud.cpp @@ -50,12 +50,12 @@ Result<String, FudStatus> getEnv(const char* name) return RetType::error(FudStatus::NotFound); } - String envVar{resultString}; - if (!envVar.valid()) { - return RetType::error(FudStatus::Failure); + auto envVarResult = String::makeFromCString(resultString); + if (envVarResult.isError()) { + return RetType::error(envVarResult); } - return RetType::okay(std::move(envVar)); + return RetType::okay(envVarResult); } } // namespace fud |