diff options
Diffstat (limited to 'c/pl.cpp')
-rw-r--r-- | c/pl.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 {}; } |