From 778d8cec8a26689a38b20a812904afeac6a94bf7 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Sun, 4 Dec 2011 16:27:32 +0000 Subject: [PATCH] [RTL]: Fix a bug in RtlGetCurrentDirectory_U. svn path=/trunk/; revision=54586 --- reactos/lib/rtl/path.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/lib/rtl/path.c b/reactos/lib/rtl/path.c index dd2b3a29847..4296c4c6f1a 100644 --- a/reactos/lib/rtl/path.c +++ b/reactos/lib/rtl/path.c @@ -899,13 +899,13 @@ RtlGetCurrentDirectory_U(IN ULONG MaximumLength, { /* Call has no space for it, fail, add the trailing slash */ RtlReleasePebLock(); - return Bytes + sizeof(L'\\'); + return Bytes + sizeof(OBJ_NAME_PATH_SEPARATOR); } } else { /* Check if caller does not have enough space */ - if (MaximumLength <= Bytes) + if (MaximumLength < Bytes) { /* Call has no space for it, fail */ RtlReleasePebLock(); @@ -917,7 +917,7 @@ RtlGetCurrentDirectory_U(IN ULONG MaximumLength, RtlCopyMemory(Buffer, CurDirName, Bytes); /* The buffer should end with a path separator */ - ASSERT(Buffer[Length - 1] == L'\\'); + ASSERT(Buffer[Length - 1] == OBJ_NAME_PATH_SEPARATOR); /* Again check for our two cases (drive root vs path) */ if ((Length <= 1) || (Buffer[Length - 2] != L':'))