From 8566655b85f0a4e515d57f6686636db516116f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 22 Aug 2022 13:13:10 +0200 Subject: Improve Win32Error, add Min. --- c/data.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'c/data.cpp') diff --git a/c/data.cpp b/c/data.cpp index 58fcde7..c1e7177 100644 --- a/c/data.cpp +++ b/c/data.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -12,9 +11,7 @@ struct InternetFile { InternetFile(const wchar_t* url) { - hi = InternetOpen(L"Episode Browser", - INTERNET_OPEN_TYPE_DIRECT, nullptr, nullptr, - /*INTERNET_FLAG_ASYNC*/0); + hi = InternetOpen(L"Episode Browser", INTERNET_OPEN_TYPE_DIRECT, nullptr, nullptr, 0); if (!hi) throw Win32Error(); @@ -73,7 +70,7 @@ bool WcharsFromXmlchars(wchar_t (&dst)[N], XmlCharPtr utf8) noexcept { /* Truncate if source is larger than destination. */ int lenUtf8 = xmlStrlen(utf8); - utf8[std::min(N, static_cast(lenUtf8))] = 0; + utf8[Min(N, static_cast(lenUtf8))] = 0; /* Convert internal representation from UTF-8 to Latin-1, * which seems to actually convert the string to proper UTF-8 -- cgit v1.2.3