From 920c739811b1556458c1271cb45301f6ff68568b Mon Sep 17 00:00:00 2001 From: pamaury Date: Mon, 1 Feb 2010 22:45:27 +0000 Subject: [PATCH] FS#10954: fix rename under simulator by Alex Bennee git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24443 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/common/io.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index d87e33197..d3fe1a997 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c @@ -418,10 +418,15 @@ int sim_remove(const char *name) int sim_rename(const char *oldname, const char *newname) { + char sim_old[MAX_PATH]; + char sim_new[MAX_PATH]; #ifdef HAVE_DIRCACHE dircache_rename(oldname, newname); #endif - return RENAME(get_sim_pathname(oldname), get_sim_pathname(newname)); + // This is needed as get_sim_pathname() has a static buffer + strncpy(sim_old, get_sim_pathname(oldname), MAX_PATH); + strncpy(sim_new, get_sim_pathname(newname), MAX_PATH); + return RENAME(sim_old, sim_new); } /* rockbox off_t may be different from system off_t */ -- 2.11.4.GIT