From 794800fb83aa5a63f33d37d1c2d9d112477b038a Mon Sep 17 00:00:00 2001 From: d0k3 Date: Wed, 4 Jul 2018 22:52:10 +0200 Subject: [PATCH] Check the results after a file entry rename --- arm9/source/filesys/fsutil.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arm9/source/filesys/fsutil.c b/arm9/source/filesys/fsutil.c index 528e7a8..d9741e0 100644 --- a/arm9/source/filesys/fsutil.c +++ b/arm9/source/filesys/fsutil.c @@ -769,7 +769,9 @@ bool PathRename(const char* path, const char* newname) { strncpy(npath, path, oldname - path); strncpy(npath + (oldname - path), newname, 255 - (oldname - path)); - return (f_rename(path, npath) == FR_OK); + if (fvx_rename(path, npath) != FR_OK) return false; + if ((fvx_stat(path, NULL) == FR_OK) || (fvx_stat(npath, NULL) != FR_OK)) return false; // safety check + return true; } bool PathAttr(const char* path, u8 attr, u8 mask) {