From 0a4d3990606a8c9873f4b96079a6e67fb0a2b48a Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 27 Sep 2009 18:30:20 +0800 Subject: [PATCH] Fixed string being copied offset --- Kernel/vfs/open.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/vfs/open.c b/Kernel/vfs/open.c index c0bbbed8..a3746147 100644 --- a/Kernel/vfs/open.c +++ b/Kernel/vfs/open.c @@ -32,7 +32,7 @@ char *VFS_GetAbsPath(char *Path) int pathLen = strlen(Path); int read, write; int pos, slashNum=1, baseLen; - Uint slashOffsets[MAX_PATH_SLASHES] = {0}; + Uint slashOffsets[MAX_PATH_SLASHES] = {1}; char *cwd = CFGPTR(CFG_VFS_CWD); int cwdLen; @@ -100,7 +100,7 @@ char *VFS_GetAbsPath(char *Path) // Only copy if the positions differ if(read != write) { Log("write = %i, read = %i", write, read); - memcpy( &ret[write], &ret[read], pos-read+1 ); + memcpy( &ret[write], &ret[read], pos-read ); } write = pos+1; if(slashNum < MAX_PATH_SLASHES) -- 2.20.1