From 6252f2715af3f7d9d56980b1e0176ad069770e5f Mon Sep 17 00:00:00 2001 From: Qiu Shumin Date: Fri, 28 Aug 2015 02:59:20 +0000 Subject: MdePkg: Refine the device path text format for Bluetooth to follow spec. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18346 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c') diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c index b8966854b2..e5f6a1f062 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--; } -- cgit v1.2.3