diff options
author | Tormod Volden <debian.tormod@gmail.com> | 2024-07-24 13:52:35 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-12-16 18:34:43 +0000 |
commit | f34a945a8024b8cb548168cae3a4a81600620ebb (patch) | |
tree | f7d6c875ca782a56c96631641c47c0666afd6b64 | |
parent | e11a912aa3bd6b3ad69bb90f36f6860de33d846a (diff) | |
download | edk2-f34a945a8024b8cb548168cae3a4a81600620ebb.tar.gz |
ShellPkg/UefiShellLib: Simplify check for empty string
StrSize() uses StrLen() which counts until the terminating NULL
character.
For checking for an empty string it is more efficient to directly check
for the NULL terminator instead of calling StrSize().
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index d053b6bb69..a512c2c251 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -4012,7 +4012,7 @@ InternalShellStrHexToUint64 ( UINT64 Result;
BOOLEAN LeadingZero;
- if ((String == NULL) || (StrSize (String) == sizeof (*String)) || (Value == NULL)) {
+ if ((String == NULL) || (*String == CHAR_NULL) || (Value == NULL)) {
return (EFI_INVALID_PARAMETER);
}
@@ -4116,7 +4116,7 @@ InternalShellStrDecimalToUint64 ( {
UINT64 Result;
- if ((String == NULL) || (StrSize (String) == sizeof (*String)) || (Value == NULL)) {
+ if ((String == NULL) || (*String == CHAR_NULL) || (Value == NULL)) {
return (EFI_INVALID_PARAMETER);
}
|