diff options
-rw-r--r-- | uisimulator/common/io.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c index d87e331970..d3fe1a997f 100644 --- a/uisimulator/common/io.c +++ b/uisimulator/common/io.c | |||
@@ -418,10 +418,15 @@ int sim_remove(const char *name) | |||
418 | 418 | ||
419 | int sim_rename(const char *oldname, const char *newname) | 419 | int sim_rename(const char *oldname, const char *newname) |
420 | { | 420 | { |
421 | char sim_old[MAX_PATH]; | ||
422 | char sim_new[MAX_PATH]; | ||
421 | #ifdef HAVE_DIRCACHE | 423 | #ifdef HAVE_DIRCACHE |
422 | dircache_rename(oldname, newname); | 424 | dircache_rename(oldname, newname); |
423 | #endif | 425 | #endif |
424 | return RENAME(get_sim_pathname(oldname), get_sim_pathname(newname)); | 426 | // This is needed as get_sim_pathname() has a static buffer |
427 | strncpy(sim_old, get_sim_pathname(oldname), MAX_PATH); | ||
428 | strncpy(sim_new, get_sim_pathname(newname), MAX_PATH); | ||
429 | return RENAME(sim_old, sim_new); | ||
425 | } | 430 | } |
426 | 431 | ||
427 | /* rockbox off_t may be different from system off_t */ | 432 | /* rockbox off_t may be different from system off_t */ |