Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <[email protected]>
---
MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c | 9 +++++----
MdePkg/Library/UefiDevicePathLib/DevicePathToText.c | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
index b896685..e5f6a1f 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
@@ -2795,17 +2795,18 @@ DevPathFromTextBluetooth (
);
Index = sizeof (BLUETOOTH_ADDRESS) - 1;
- while (!IS_NULL(BluetoothStr) && Index >= 0) {
- Walker = SplitStr (&BluetoothStr, L':');
- TempBufferSize = StrSize (Walker) + StrLen (L"0x") * sizeof (CHAR16);
+ Walker = BluetoothStr;
+ while (!IS_NULL(*Walker) && Index >= 0) {
+ TempBufferSize = 2 * sizeof(CHAR16) + StrSize(L"0x");
TempNumBuffer = AllocateZeroPool (TempBufferSize);
if (TempNumBuffer == NULL) {
break;
}
StrCpyS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), L"0x");
- StrCatS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), Walker);
+ StrnCatS (TempNumBuffer, TempBufferSize / sizeof (CHAR16), Walker, 2);
BluetoothDp->BD_ADDR.Address[Index] = (UINT8)Strtoi (TempNumBuffer);
FreePool (TempNumBuffer);
+ Walker += 2;
Index--;
}
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
index be4619a..627308c 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
@@ -1584,7 +1584,7 @@ DevPathToTextBluetooth (
Bluetooth = DevPath;
UefiDevicePathLibCatPrint (
Str,
- L"Bluetooth(%02x:%02x:%02x:%02x:%02x:%02x)",
+ L"Bluetooth(%02x%02x%02x%02x%02x%02x)",
Bluetooth->BD_ADDR.Address[5],
Bluetooth->BD_ADDR.Address[4],
Bluetooth->BD_ADDR.Address[3],
--
1.9.5.msysgit.1
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel