]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLib/UefiShellLib.c
ShellPkg: Update string to number conversion to correctly stop at spaces if so requested.
[mirror_edk2.git] / ShellPkg / Library / UefiShellLib / UefiShellLib.c
index 1929349b2038aa2a7f4f197eb532ef442d7459b7..75ecfa503e82d2daed41d82c4ae955e3c399c05c 100644 (file)
@@ -3650,10 +3650,10 @@ InternalShellStrHexToUint64 (
   Result = 0;\r
 \r
   //\r
-  // Skip spaces if requested\r
+  // stop at spaces if requested\r
   //\r
-  while (StopAtSpace && *String == L' ') {\r
-    String++;\r
+  if (StopAtSpace && *String == L' ') {\r
+    break;\r
   }\r
 \r
   while (ShellIsHexaDecimalDigitCharacter (*String)) {\r