From 2ef9435a77860fbb7f45dc5f115908c4b0bf9695 Mon Sep 17 00:00:00 2001 From: klu2 Date: Sun, 31 May 2009 05:44:48 +0000 Subject: [PATCH] Fix the bug that PCD driver treat StringTableIndex as UINT8 value but in fact it is UINT16 value. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8412 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/PCD/Dxe/Service.c | 2 +- MdeModulePkg/Universal/PCD/Pei/Service.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index 60080f13f7..dd0ff7e2c5 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -161,7 +161,7 @@ GetWorker ( break; case PCD_TYPE_STRING: - StringTableIdx = (UINT16) *((UINT8 *) PcdDb + Offset); + StringTableIdx = *(UINT16*)((UINT8 *) PcdDb + Offset); RetPtr = (VOID *) (StringTable + StringTableIdx); break; diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.c b/MdeModulePkg/Universal/PCD/Pei/Service.c index ff59b81dcd..200c0d4639 100644 --- a/MdeModulePkg/Universal/PCD/Pei/Service.c +++ b/MdeModulePkg/Universal/PCD/Pei/Service.c @@ -640,7 +640,7 @@ GetWorker ( return (VOID *) ((UINT8 *)PeiPcdDb + Offset); case PCD_TYPE_STRING: - StringTableIdx = (UINT16) *((UINT8 *) PeiPcdDb + Offset); + StringTableIdx = * (UINT16*) ((UINT8 *) PeiPcdDb + Offset); return (VOID *) (&StringTable[StringTableIdx]); default: