overlapping memcpy -> memmove (#1342)

This commit is contained in:
ManDude 2022-04-30 01:07:58 +01:00 committed by GitHub
parent f9313d8260
commit 08d701bb26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -429,8 +429,8 @@ void pc_game_load_open_file(FILE* fd) {
mc_print(fmt::format("loading bank {}", bank));
u32 current_save_count = headers[bank]->save_count;
memcpy(op.data_ptr.c(), op.data_ptr.c() + bank * BANK_TOTAL_SIZE + sizeof(McHeader),
BANK_SIZE);
memmove(op.data_ptr.c(), op.data_ptr.c() + bank * BANK_TOTAL_SIZE + sizeof(McHeader),
BANK_SIZE);
mc_last_file = op.param2;
mc_files[op.param2].most_recent_save_count = current_save_count;
mc_files[op.param2].last_saved_bank = bank;