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;