diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-28 15:01:53 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-28 15:01:53 +0000 |
commit | d3e0289ccf641481f2cbdcbb0d5868c393b7edbb (patch) | |
tree | bbc80abec5b5318808e2f79ab05c92343e66f41d /MdePkg | |
parent | c60ea9a873b8fe0c4b9409b28d1608f7f80c9c22 (diff) | |
download | edk2-d3e0289ccf641481f2cbdcbb0d5868c393b7edbb.zip edk2-d3e0289ccf641481f2cbdcbb0d5868c393b7edbb.tar.gz edk2-d3e0289ccf641481f2cbdcbb0d5868c393b7edbb.tar.bz2 |
Clarify the requirements for the Destination parameter of UnicodeStrToAsciiStr.
signed-off-by:jcarsey
Reviewed-by:lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11917 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r-- | MdePkg/Include/Library/BaseLib.h | 3 | ||||
-rw-r--r-- | MdePkg/Library/BaseLib/String.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h index c74ea23..6998171 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -636,6 +636,9 @@ StrHexToUint64 ( to the ASCII string Destination by copying the lower 8 bits of
each Unicode character. It returns Destination.
+ The caller is responsible to make sure Destination points to a buffer with size
+ equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
+
If any Unicode characters in Source contain non-zero value in
the upper 8 bits, then ASSERT().
diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c index 273291a..227a0dc 100644 --- a/MdePkg/Library/BaseLib/String.c +++ b/MdePkg/Library/BaseLib/String.c @@ -1,7 +1,7 @@ /** @file
Unicode and ASCII string primatives.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -995,6 +995,9 @@ InternalAsciiIsHexaDecimalDigitCharacter ( to the ASCII string Destination by copying the lower 8 bits of
each Unicode character. It returns Destination.
+ The caller is responsible to make sure Destination points to a buffer with size
+ equal or greater than ((StrLen (Source) + 1) * sizeof (CHAR8)) in bytes.
+
If any Unicode characters in Source contain non-zero value in
the upper 8 bits, then ASSERT().
|