summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/DriverSampleDxe
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2017-01-18 10:31:02 +0800
committerHao Wu <hao.a.wu@intel.com>2017-03-02 09:58:11 +0800
commit9f4048f7f8cd4b6bd5eee0f0c4bfd4eb6926a536 (patch)
tree0b3a079754cfcbf7c867e13d4eaefdc5545dcb23 /MdeModulePkg/Universal/DriverSampleDxe
parent0438f5e287fa40c7aa143c3a151c5e5c743411b3 (diff)
downloadedk2-9f4048f7f8cd4b6bd5eee0f0c4bfd4eb6926a536.tar.gz
edk2-9f4048f7f8cd4b6bd5eee0f0c4bfd4eb6926a536.tar.bz2
edk2-9f4048f7f8cd4b6bd5eee0f0c4bfd4eb6926a536.zip
MdeModulePkg: Replace [Ascii|Unicode]ValueToString
It is the follow up of commits 51f0ceb..9e32e97 to replace AsciiValueToString/UnicodeValueToString with AsciiValueToStringS/UnicodeValueToStringS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Universal/DriverSampleDxe')
-rw-r--r--MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
index 67a40b7d63..f103b9ca21 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
+++ b/MdeModulePkg/Universal/DriverSampleDxe/DriverSample.c
@@ -725,12 +725,14 @@ ExtractConfig (
BackupChar = Value[ValueStrLen];
*Value++ = L'=';
- Value += UnicodeValueToString (
- Value,
- PREFIX_ZERO | RADIX_HEX,
- PrivateData->Configuration.NameValueVar0,
- sizeof (PrivateData->Configuration.NameValueVar0) * 2
- );
+ UnicodeValueToStringS (
+ Value,
+ BufferSize - ((UINTN)Value - (UINTN)*Results),
+ PREFIX_ZERO | RADIX_HEX,
+ PrivateData->Configuration.NameValueVar0,
+ sizeof (PrivateData->Configuration.NameValueVar0) * 2
+ );
+ Value += StrnLenS (Value, (BufferSize - ((UINTN)Value - (UINTN)*Results)) / sizeof (CHAR16));
*Value = BackupChar;
}
@@ -744,12 +746,14 @@ ExtractConfig (
BackupChar = Value[ValueStrLen];
*Value++ = L'=';
- Value += UnicodeValueToString (
- Value,
- PREFIX_ZERO | RADIX_HEX,
- PrivateData->Configuration.NameValueVar1,
- sizeof (PrivateData->Configuration.NameValueVar1) * 2
- );
+ UnicodeValueToStringS (
+ Value,
+ BufferSize - ((UINTN)Value - (UINTN)*Results),
+ PREFIX_ZERO | RADIX_HEX,
+ PrivateData->Configuration.NameValueVar1,
+ sizeof (PrivateData->Configuration.NameValueVar1) * 2
+ );
+ Value += StrnLenS (Value, (BufferSize - ((UINTN)Value - (UINTN)*Results)) / sizeof (CHAR16));
*Value = BackupChar;
}
@@ -767,7 +771,14 @@ ExtractConfig (
//
StrPointer = (CHAR16 *) PrivateData->Configuration.NameValueVar2;
for (; *StrPointer != L'\0'; StrPointer++) {
- Value += UnicodeValueToString (Value, PREFIX_ZERO | RADIX_HEX, *StrPointer, 4);
+ UnicodeValueToStringS (
+ Value,
+ BufferSize - ((UINTN)Value - (UINTN)*Results),
+ PREFIX_ZERO | RADIX_HEX,
+ *StrPointer,
+ 4
+ );
+ Value += StrnLenS (Value, (BufferSize - ((UINTN)Value - (UINTN)*Results)) / sizeof (CHAR16));
}
}