summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Application/Shell/ShellProtocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Application/Shell/ShellProtocol.c')
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c
index b3b8acc0d0..991fb58ca7 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -477,7 +477,7 @@ EfiShellGetFilePathFromDevicePath(
// UEFI Shell spec section 3.7)
if ((PathSize != 0) &&
(PathForReturn != NULL) &&
- (PathForReturn[PathSize - 1] != L'\\') &&
+ (PathForReturn[PathSize / sizeof (CHAR16) - 1] != L'\\') &&
(AlignedNode->PathName[0] != L'\\')) {
PathForReturn = StrnCatGrow (&PathForReturn, &PathSize, L"\\", 1);
}