summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/main.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-10-02 16:08:16 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-10-02 16:08:16 +0000
commit089e7f228a5d22219ddb059674809c47769d5e53 (patch)
tree40986759192a2e405fb881388ae2ab6e7f377125 /plugins/Toaster/src/main.cpp
parent62713cf3eece92588464ce06810146f5c5cece8e (diff)
Toaster: coverity fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15488 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src/main.cpp')
-rw-r--r--plugins/Toaster/src/main.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/plugins/Toaster/src/main.cpp b/plugins/Toaster/src/main.cpp
index e7006bb52d..e489c11e61 100644
--- a/plugins/Toaster/src/main.cpp
+++ b/plugins/Toaster/src/main.cpp
@@ -44,12 +44,18 @@ extern "C" int __declspec(dllexport) Load(void)
InitServices();
- GetEnvironmentVariableW(L"TEMP", wszTempDir, MAX_PATH);
- wcscat_s(wszTempDir, L"\\Miranda.Toaster");
+ if (GetEnvironmentVariableW(L"TEMP", wszTempDir, MAX_PATH) != 0)
+ {
+ wcscat_s(wszTempDir, L"\\Miranda.Toaster");
- DWORD dwAttributes = GetFileAttributes(wszTempDir);
- if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
- CreateDirectoryTreeT(wszTempDir);
+ DWORD dwAttributes = GetFileAttributes(wszTempDir);
+ if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
+ CreateDirectoryTreeT(wszTempDir);
+ }
+ else
+ {
+ MessageBox(NULL, TranslateT("Failed create temporary directory"), _T(MODULE), MB_OK | MB_ICONERROR);
+ }
return 0;
}