Tera Termの個人的な作業用リポジトリ
リビジョン | 1560ef405ded690d9652a450ff3a724c8618cb95 (tree) |
---|---|
日時 | 2022-09-08 00:21:24 |
作者 | zmatsuo <zmatsuo@user...> |
コミッター | zmatsuo |
hGetFullPathNameW() で例外が出るケースがあったので修正
git-svn-id: svn+ssh://svn.osdn.net/svnroot/ttssh2/trunk@10252 f5f01b69-1e22-0410-acbf-894ab4bd6246
@@ -116,7 +116,7 @@ DWORD hGetPrivateProfileStringW(const wchar_t *section, const wchar_t *key, cons | ||
116 | 116 | for(;;) { |
117 | 117 | DWORD r = GetPrivateProfileStringW(section, key, def, b, (DWORD)size, ini); |
118 | 118 | if (r == 0 || b[0] == L'\0') { |
119 | - DWORD error = GetLastError(); | |
119 | + error = GetLastError(); | |
120 | 120 | free(b); |
121 | 121 | *str = _wcsdup(L""); |
122 | 122 | // aswprintf(str, L"%s/%s\n",section, key); // 確認用 |
@@ -157,7 +157,9 @@ DWORD hGetFullPathNameW(const wchar_t *lpFileName, wchar_t **fullpath, wchar_t * | ||
157 | 157 | size_t len = GetFullPathNameW(lpFileName, 0, NULL, NULL); // include L'\0' |
158 | 158 | if (len == 0) { |
159 | 159 | *fullpath = NULL; |
160 | - *filepart = NULL; | |
160 | + if (filepart != NULL) { | |
161 | + *filepart = NULL; | |
162 | + } | |
161 | 163 | return GetLastError(); |
162 | 164 | } |
163 | 165 | wchar_t *path = (wchar_t *)malloc(sizeof(wchar_t) * len); |