Skip to content

[rcore] refactor possible data loss on FileMove()#5682

Open
lvntky wants to merge 1 commit intoraysan5:masterfrom
lvntky:rcore-ref_2
Open

[rcore] refactor possible data loss on FileMove()#5682
lvntky wants to merge 1 commit intoraysan5:masterfrom
lvntky:rcore-ref_2

Conversation

@lvntky
Copy link

@lvntky lvntky commented Mar 22, 2026

The FireRemove() function was called without any checks. If FileCopy encountered an error for any reason, FileRemove() would irreversibly delete the copied data.

Also result was initialized to 0 (success) making the return
value meaningless when FileCopy() or FileRemove() failed.

Fix by checking FileCopy() return value before removing the source
file, and initializing result to -1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant