diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-03-12 00:57:05 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-03-12 00:57:05 +0000 |
commit | ed2405a0ed4e880f78aa0536e83f39d1b91b721b (patch) | |
tree | 37b34ffa4b3c40adfc9abd3a39d35547e3a65a02 /ArmPkg/Filesystem | |
parent | bc87b5075aea8d00ae2837b9aff43a055b665066 (diff) | |
download | edk2-platforms-ed2405a0ed4e880f78aa0536e83f39d1b91b721b.tar.xz |
ArmPkg/SemihostFs: Use Unicode to Ascii function for the conversion
The Unicode to Ascii string conversion was done manually.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14186 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Filesystem')
-rw-r--r-- | ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c index 059845c04d..6443a7bf44 100644 --- a/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c +++ b/ArmPkg/Filesystem/SemihostFs/Arm/SemihostFs.c @@ -155,8 +155,6 @@ FileOpen ( EFI_STATUS Status = EFI_SUCCESS;
UINTN SemihostHandle;
CHAR8 *AsciiFileName;
- CHAR8 *AsciiPtr;
- UINTN Length;
UINT32 SemihostMode;
BOOLEAN IsRoot;
@@ -164,19 +162,12 @@ FileOpen ( return EFI_INVALID_PARAMETER;
}
- // Semihost interface requires ASCII filesnames
- Length = StrSize (FileName);
-
- AsciiFileName = AllocatePool (Length);
+ // Semihost interface requires ASCII filenames
+ AsciiFileName = AllocatePool ((StrLen (FileName) + 1) * sizeof (CHAR8));
if (AsciiFileName == NULL) {
return EFI_OUT_OF_RESOURCES;
}
-
- AsciiPtr = AsciiFileName;
-
- while (Length--) {
- *AsciiPtr++ = *FileName++ & 0xFF;
- }
+ UnicodeStrToAsciiStr (FileName, AsciiFileName);
if ((AsciiStrCmp (AsciiFileName, "\\") == 0) ||
(AsciiStrCmp (AsciiFileName, "/") == 0) ||
|