aboutsummaryrefslogtreecommitdiff
path: root/c/pl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/pl.cpp')
-rw-r--r--c/pl.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/c/pl.cpp b/c/pl.cpp
index 665fe3a..1255609 100644
--- a/c/pl.cpp
+++ b/c/pl.cpp
@@ -90,10 +90,11 @@ int Query::NextSolution()
}
/* Convert Prolog term to wide characters. */
-int PlString(const term_t t, std::wstring* const pWs, const int iFlags)
+wstring_owner PlString(const term_t t, const int iFlags)
{
char* sz;
- int r = PL_get_chars(t, &sz, iFlags);
- if (r) *pWs = WsFromSz(sz);
- return r;
+ if (PL_get_chars(t, &sz, iFlags))
+ return {WsoFromSz(sz)};
+ else
+ return {};
}