summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorYao, Jiewen <Jiewen.Yao@intel.com>2015-05-06 00:46:51 +0000
committerjyao1 <jyao1@Edk2>2015-05-06 00:46:51 +0000
commit0e93edbbc09be02585c21cb022b4f34add67c79e (patch)
tree9d733d6086eaeac23c267772dd3d77c894d50140 /MdePkg
parente1455b04126ce034301c81c0665d221af14464c6 (diff)
downloadedk2-platforms-0e93edbbc09be02585c21cb022b4f34add67c79e.tar.xz
Add ASSERT comment for SafeString API in BaseLib for MdePkg.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: "Yao, Jiewen" <Jiewen.Yao@intel.com> Reviewed-by: "Carsey, Jaben" <jaben.carsey@intel.com> Reviewed-by: "Justen, Jordan L" <jordan.l.justen@intel.com> Reviewed-by: "Gao, Liming" <Liming.Gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17310 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Library/BaseLib.h14
-rw-r--r--MdePkg/Library/BaseLib/SafeString.c14
2 files changed, 26 insertions, 2 deletions
diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h
index 59cf4ed9f1..7e10804082 100644
--- a/MdePkg/Include/Library/BaseLib.h
+++ b/MdePkg/Include/Library/BaseLib.h
@@ -211,6 +211,7 @@ StrnLenS (
If Destination is not aligned on a 16-bit boundary, then ASSERT().
If Source is not aligned on a 16-bit boundary, then ASSERT().
+ If an error would be returned, then the function will also ASSERT().
@param Destination A pointer to a Null-terminated Unicode string.
@param DestMax The maximum number of Destination Unicode
@@ -242,6 +243,7 @@ StrCpyS (
If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
+ If an error would be returned, then the function will also ASSERT().
@param Destination A pointer to a Null-terminated Unicode string.
@param DestMax The maximum number of Destination Unicode
@@ -275,6 +277,7 @@ StrnCpyS (
If Destination is not aligned on a 16-bit boundary, then ASSERT().
If Source is not aligned on a 16-bit boundary, then ASSERT().
+ If an error would be returned, then the function will also ASSERT().
@param Destination A pointer to a Null-terminated Unicode string.
@param DestMax The maximum number of Destination Unicode
@@ -309,7 +312,8 @@ StrCatS (
set to null.
If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If and Source is not aligned on a 16-bit boundary, then ASSERT().
+ If Source is not aligned on a 16-bit boundary, then ASSERT().
+ If an error would be returned, then the function will also ASSERT().
@param Destination A pointer to a Null-terminated Unicode string.
@param DestMax The maximum number of Destination Unicode
@@ -362,6 +366,8 @@ AsciiStrnLenS (
Copies the string pointed to by Source (including the terminating null char)
to the array pointed to by Destination.
+ If an error would be returned, then the function will also ASSERT().
+
@param Destination A pointer to a Null-terminated Ascii string.
@param DestMax The maximum number of Destination Ascii
char, including terminating null char.
@@ -390,6 +396,8 @@ AsciiStrCpyS (
Source to the array pointed to by Destination. If no null char is copied from
Source, then Destination[Length] is always set to null.
+ If an error would be returned, then the function will also ASSERT().
+
@param Destination A pointer to a Null-terminated Ascii string.
@param DestMax The maximum number of Destination Ascii
char, including terminating null char.
@@ -420,6 +428,8 @@ AsciiStrnCpyS (
Appends a copy of the string pointed to by Source (including the terminating
null char) to the end of the string pointed to by Destination.
+ If an error would be returned, then the function will also ASSERT().
+
@param Destination A pointer to a Null-terminated Ascii string.
@param DestMax The maximum number of Destination Ascii
char, including terminating null char.
@@ -452,6 +462,8 @@ AsciiStrCatS (
copied from Source, then Destination[StrLen(Destination) + Length] is always
set to null.
+ If an error would be returned, then the function will also ASSERT().
+
@param Destination A pointer to a Null-terminated Ascii string.
@param DestMax The maximum number of Destination Ascii
char, including terminating null char.
diff --git a/MdePkg/Library/BaseLib/SafeString.c b/MdePkg/Library/BaseLib/SafeString.c
index 7d7765bc01..7c1b0758f3 100644
--- a/MdePkg/Library/BaseLib/SafeString.c
+++ b/MdePkg/Library/BaseLib/SafeString.c
@@ -153,6 +153,7 @@ StrnLenS (
If Destination is not aligned on a 16-bit boundary, then ASSERT().
If Source is not aligned on a 16-bit boundary, then ASSERT().
+ If an error would be returned, then the function will also ASSERT().
@param Destination A pointer to a Null-terminated Unicode string.
@param DestMax The maximum number of Destination Unicode
@@ -230,6 +231,7 @@ StrCpyS (
If Length > 0 and Destination is not aligned on a 16-bit boundary, then ASSERT().
If Length > 0 and Source is not aligned on a 16-bit boundary, then ASSERT().
+ If an error would be returned, then the function will also ASSERT().
@param Destination A pointer to a Null-terminated Unicode string.
@param DestMax The maximum number of Destination Unicode
@@ -318,6 +320,7 @@ StrnCpyS (
If Destination is not aligned on a 16-bit boundary, then ASSERT().
If Source is not aligned on a 16-bit boundary, then ASSERT().
+ If an error would be returned, then the function will also ASSERT().
@param Destination A pointer to a Null-terminated Unicode string.
@param DestMax The maximum number of Destination Unicode
@@ -413,7 +416,8 @@ StrCatS (
set to null.
If Destination is not aligned on a 16-bit boundary, then ASSERT().
- If and Source is not aligned on a 16-bit boundary, then ASSERT().
+ If Source is not aligned on a 16-bit boundary, then ASSERT().
+ If an error would be returned, then the function will also ASSERT().
@param Destination A pointer to a Null-terminated Unicode string.
@param DestMax The maximum number of Destination Unicode
@@ -557,6 +561,8 @@ AsciiStrnLenS (
Copies the string pointed to by Source (including the terminating null char)
to the array pointed to by Destination.
+ If an error would be returned, then the function will also ASSERT().
+
@param Destination A pointer to a Null-terminated Ascii string.
@param DestMax The maximum number of Destination Ascii
char, including terminating null char.
@@ -628,6 +634,8 @@ AsciiStrCpyS (
Source to the array pointed to by Destination. If no null char is copied from
Source, then Destination[Length] is always set to null.
+ If an error would be returned, then the function will also ASSERT().
+
@param Destination A pointer to a Null-terminated Ascii string.
@param DestMax The maximum number of Destination Ascii
char, including terminating null char.
@@ -710,6 +718,8 @@ AsciiStrnCpyS (
Appends a copy of the string pointed to by Source (including the terminating
null char) to the end of the string pointed to by Destination.
+ If an error would be returned, then the function will also ASSERT().
+
@param Destination A pointer to a Null-terminated Ascii string.
@param DestMax The maximum number of Destination Ascii
char, including terminating null char.
@@ -800,6 +810,8 @@ AsciiStrCatS (
copied from Source, then Destination[StrLen(Destination) + Length] is always
set to null.
+ If an error would be returned, then the function will also ASSERT().
+
@param Destination A pointer to a Null-terminated Ascii string.
@param DestMax The maximum number of Destination Ascii
char, including terminating null char.