aboutsummaryrefslogtreecommitdiff
path: root/c/main.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-24 02:05:30 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-24 02:05:30 +0200
commit98f28569b631d36a6f129a17ea7589b48884c1eb (patch)
tree45fdc18108edaf45fa424324591ab7a7aaa1db10 /c/main.cpp
parent3a133c4063cbb81bee9f5bc55427be75d8e584e0 (diff)
downloadEpisodeBrowser-98f28569b631d36a6f129a17ea7589b48884c1eb.tar.gz
Fix PL_get_tchars.
See c6cd2f1.
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) {