From 98f28569b631d36a6f129a17ea7589b48884c1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 24 Jul 2022 02:05:30 +0200 Subject: Fix PL_get_tchars. See c6cd2f1. --- c/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'c/main.cpp') 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(TEXT("a Prolog exception"), tsz); + std::basic_string tstr; + if (PlString(t, &tstr)) + TerminateMsg(TEXT("a Prolog exception"), tstr.c_str()); else TerminateMsg("a Prolog exception", NULL); } catch (const Win32Error& e) { -- cgit v1.2.3