aboutsummaryrefslogtreecommitdiff
path: root/c/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/main.cpp')
-rw-r--r--c/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/c/main.cpp b/c/main.cpp
index 6865e4c..d59fd1d 100644
--- a/c/main.cpp
+++ b/c/main.cpp
@@ -64,9 +64,9 @@ void OnTerminate() noexcept
try {
std::rethrow_exception(std::current_exception());
} catch (const term_t& t) {
- TCHAR* tsz;
- if (PL_get_tchars(t, &tsz, CVT_WRITE))
- TerminateMsg<TCHAR>(TEXT("a Prolog exception"), tsz);
+ std::basic_string<TCHAR> tstr;
+ if (PlString(t, &tstr))
+ TerminateMsg<TCHAR>(TEXT("a Prolog exception"), tstr.c_str());
else
TerminateMsg<char>("a Prolog exception", NULL);
} catch (const Win32Error& e) {