From f8c454733b3b4fa7c55011d72840a8731410d9e4 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 4 Mar 2015 10:35:06 +0300 Subject: [PATCH] Remove dangerous string manipulation, merge declaration with assignment --- modules/core/src/system.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp index fed5c9e4ea..7f9b93d605 100644 --- a/modules/core/src/system.cpp +++ b/modules/core/src/system.cpp @@ -549,13 +549,9 @@ String tempfile( const char* suffix ) #if defined WIN32 || defined _WIN32 #ifdef WINRT RoInitialize(RO_INIT_MULTITHREADED); - std::wstring temp_dir = L""; - const wchar_t* opencv_temp_dir = GetTempPathWinRT().c_str(); - if (opencv_temp_dir) - temp_dir = std::wstring(opencv_temp_dir); + std::wstring temp_dir = GetTempPathWinRT(); - std::wstring temp_file; - temp_file = GetTempFileNameWinRT(L"ocv"); + std::wstring temp_file = GetTempFileNameWinRT(L"ocv"); if (temp_file.empty()) return String();