From 4ca00c7299ab33c57c74a6183a20516c517e79f2 Mon Sep 17 00:00:00 2001 From: n-a-c-h <> Date: Sun, 10 Jul 2005 20:43:06 +0000 Subject: [PATCH] Removed duplicate code. Changed strcpy() to memmove() in filename change because destinations can overlap. --- zsnes/src/linux/zfilew.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/zsnes/src/linux/zfilew.c b/zsnes/src/linux/zfilew.c index 0a0038c5..1755b114 100644 --- a/zsnes/src/linux/zfilew.c +++ b/zsnes/src/linux/zfilew.c @@ -512,17 +512,9 @@ void GetFilename() while (*tmp!=0) tmp++; while (*tmp!='/') tmp--; size = (strlen(tmp)-1) & 0xFF; - strcpy(&fnamest, tmp); + memmove(&fnamest, tmp, strlen(tmp)); fnamest = size; statefileloc-=(tmp-&fnamest); - - tmp = &fnames; - *tmp = '/'; - while (*tmp!=0) tmp++; - while (*tmp!='/') tmp--; - size = (strlen(tmp)-1) & 0xFF; - strcpy(&fnames, tmp); - fnames = size; } char *olddir = NULL;