From fbbeb4d6a9c42921d4a146134d18fcc40cda7be6 Mon Sep 17 00:00:00 2001 From: Syoyo Fujita Date: Sat, 6 Jun 2020 17:11:50 +0900 Subject: [PATCH] Use nullptr instead of NULL. --- tiny_gltf.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 108c8e1..708ca02 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -2543,15 +2543,16 @@ bool FileExists(const std::string &abs_filename, void *) { std::string ExpandFilePath(const std::string &filepath, void *) { #ifdef _WIN32 + // Assume input `filepath` is encoded in UTF-8 std::wstring wfilepath = UTF8ToWchar(filepath); - DWORD wlen = ExpandEnvironmentStringsW(wfilepath.c_str(), NULL, 0); + DWORD wlen = ExpandEnvironmentStringsW(wfilepath.c_str(), nullptr, 0); wchar_t *wstr = new wchar_t[wlen]; ExpandEnvironmentStringsW(wfilepath.c_str(), wstr, wlen); std::wstring ws(wstr); delete[] wstr; return WcharToUTF8(ws); - + #else #if defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR) || \