]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Common/ParseInf.c
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / C / Common / ParseInf.c
index 4d10ff8b0c30dacdee7cfe2e5877bf716f0858d0..5ef8f1306d65d949b44c63cf9e91dd147337c7f0 100644 (file)
@@ -2,13 +2,7 @@
 This contains some useful functions for parsing INF files.\r
 \r
 Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -233,7 +227,7 @@ Returns:
   CHAR8   *Delimiter;\r
   BOOLEAN ParseError;\r
   BOOLEAN ReadError;\r
-  UINTN   Occurrance;\r
+  UINTN   Occurrence;\r
 \r
   //\r
   // Check input parameters\r
@@ -258,7 +252,7 @@ Returns:
   //\r
   // Initialize our instance counter for the search token\r
   //\r
-  Occurrance = 0;\r
+  Occurrence = 0;\r
 \r
   if (FindSection (InputFile, Section)) {\r
     //\r
@@ -307,7 +301,7 @@ Returns:
         //\r
         // Check if it is the correct instance\r
         //\r
-        if (Instance == Occurrance) {\r
+        if (Instance == Occurrence) {\r
           //\r
           // Copy the contents following the =\r
           //\r
@@ -338,9 +332,9 @@ Returns:
           }\r
         } else {\r
           //\r
-          // Increment the occurrance found\r
+          // Increment the occurrence found\r
           //\r
-          Occurrance++;\r
+          Occurrence++;\r
         }\r
       }\r
     } while (\r
@@ -348,7 +342,7 @@ Returns:
       !ReadError &&\r
       InputFile->CurrentFilePointer < InputFile->Eof &&\r
       CurrentToken[0] != '[' &&\r
-      Occurrance <= Instance\r
+      Occurrence <= Instance\r
     );\r
   }\r
   //\r
@@ -478,7 +472,7 @@ AsciiStringToUint64 (
 Routine Description:\r
 \r
   Converts a null terminated ascii string that represents a number into a\r
-  UINT64 value.  A hex number may be preceeded by a 0x, but may not be\r
+  UINT64 value.  A hex number may be preceded by a 0x, but may not be\r
   succeeded by an h.  A number without 0x or 0X is considered to be base 10\r
   unless the IsHex input is true.\r
 \r
@@ -508,7 +502,7 @@ Returns:
   //\r
   // Check input parameter\r
   //\r
-  if (AsciiString == NULL || ReturnValue == NULL) {\r
+  if (AsciiString == NULL || ReturnValue == NULL || strlen(AsciiString) > 0xFF) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
   while (AsciiString[Index] == ' ') {\r