diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-01-25 23:43:57 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-01-25 23:43:57 +0900 |
commit | 3a59fb7b1c7c68c70c3725b086faeeb51236f720 (patch) | |
tree | 9c02a0be99d077b9c3cfba17aa7d78e40b2b5cce /win32/main.c | |
parent | 296ef17d3452e00a8d29f76493152fe7ea53665b (diff) |
corrected uncaught mistakes found with msvc
Diffstat (limited to 'win32/main.c')
-rw-r--r-- | win32/main.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/win32/main.c b/win32/main.c index a7b5ba2..d4caf05 100644 --- a/win32/main.c +++ b/win32/main.c @@ -90,16 +90,16 @@ static HANDLE pvisearch(const wchar_t *filename, const char *pviname_a) { WPVINAMELEN = 8*2+1+3+1, }; wchar_t pviname[WPVINAMELEN]; - wchar_t pvipath[PATH_MAX]; + wchar_t pvipath[MAX_PATH]; if (MultiByteToWideChar(932, MB_ERR_INVALID_CHARS, pviname_a, -1, pviname, WPVINAMELEN) == 0) { return INVALID_HANDLE_VALUE; } lstrcat(pviname, L".PVI"); - if (lstrlen(filename) >= PATH_MAX) return INVALID_HANDLE_VALUE; + if (lstrlen(filename) >= MAX_PATH) return INVALID_HANDLE_VALUE; lstrcpy(pvipath, filename); PathRemoveFileSpec(pvipath); - if (lstrlen(pvipath) + lstrlen(pviname) + 1 >= PATH_MAX) { + if (lstrlen(pvipath) + lstrlen(pviname) + 1 >= MAX_PATH) { return INVALID_HANDLE_VALUE; } lstrcat(pvipath, L"\\"); @@ -552,7 +552,9 @@ int CALLBACK wWinMain(HINSTANCE hinst, HINSTANCE hpinst, ); ShowWindow(hwnd, cmdshow); - openfile(hwnd, argfile); + if (argfile) { + openfile(hwnd, argfile); + } MSG msg = {0}; while (GetMessage(&msg, 0, 0, 0)) { |