summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorTormod Volden <debian.tormod@gmail.com>2024-07-24 13:52:35 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-12-16 18:34:43 +0000
commitf34a945a8024b8cb548168cae3a4a81600620ebb (patch)
treef7d6c875ca782a56c96631641c47c0666afd6b64 /ShellPkg
parente11a912aa3bd6b3ad69bb90f36f6860de33d846a (diff)
downloadedk2-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>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c4
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);
}