From 41de3d29200e24cdbdc26d0b56a52935722357a0 Mon Sep 17 00:00:00 2001 From: nomdenom Date: Sun, 23 Sep 2018 20:29:44 -0700 Subject: [PATCH] Use INVALID_HANDLE --- Source/pfile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/pfile.cpp b/Source/pfile.cpp index 133ea6ef4..f7f62bc51 100644 --- a/Source/pfile.cpp +++ b/Source/pfile.cpp @@ -279,7 +279,7 @@ BOOL __stdcall pfile_ui_set_hero_infos(BOOL (__stdcall *ui_add_hero_info)(_uiher break; GetSaveDirectory(FileName, 260, (int)lpSrcStr); v1 = strrchr(FileName, '\\') + 1; - if ( v1 != (char *)1 && OpenFile(FileName, &ReOpenBuff, 0x4000u) != -1 ) + if ( v1 != (char *)1 && OpenFile(FileName, &ReOpenBuff, 0x4000u) != INVALID_HANDLE ) { if ( !SRegLoadString("Diablo\\Converted", (const char *)v1, 0, NewFileName, 260) ) { @@ -287,7 +287,7 @@ BOOL __stdcall pfile_ui_set_hero_infos(BOOL (__stdcall *ui_add_hero_info)(_uiher { v3 = save_num++; pfile_get_save_path(NewFileName, 260, v3); - if ( OpenFile(NewFileName, &ReOpenBuff, 0x4000u) == -1 ) + if ( OpenFile(NewFileName, &ReOpenBuff, 0x4000u) == INVALID_HANDLE ) break; if ( (unsigned int)save_num >= MAX_CHARACTERS ) goto LABEL_13;