diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-22 13:13:10 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-22 13:13:10 +0200 |
commit | 8566655b85f0a4e515d57f6686636db516116f95 (patch) | |
tree | d27ec314359a083210492a371b5fce1761e734ae /c/data.cpp | |
parent | ee1eafe1ed12c2c46ed31ad560daeae11ab1e027 (diff) | |
download | EpisodeBrowser-8566655b85f0a4e515d57f6686636db516116f95.tar.gz |
Improve Win32Error, add Min.
Diffstat (limited to 'c/data.cpp')
-rw-r--r-- | c/data.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1,4 +1,3 @@ -#include <algorithm> #include <windows.h> #include <wininet.h> #include <libxml/HTMLparser.h> @@ -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<size_t>(lenUtf8))] = 0; + utf8[Min(N, static_cast<size_t>(lenUtf8))] = 0; /* Convert internal representation from UTF-8 to Latin-1, * which seems to actually convert the string to proper UTF-8 |