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
CHAR8 *Delimiter;\r
BOOLEAN ParseError;\r
BOOLEAN ReadError;\r
- UINTN Occurrance;\r
+ UINTN Occurrence;\r
\r
//\r
// Check input parameters\r
//\r
// Initialize our instance counter for the search token\r
//\r
- Occurrance = 0;\r
+ Occurrence = 0;\r
\r
if (FindSection (InputFile, Section)) {\r
//\r
//\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
}\r
} else {\r
//\r
- // Increment the occurrance found\r
+ // Increment the occurrence found\r
//\r
- Occurrance++;\r
+ Occurrence++;\r
}\r
}\r
} while (\r
!ReadError &&\r
InputFile->CurrentFilePointer < InputFile->Eof &&\r
CurrentToken[0] != '[' &&\r
- Occurrance <= Instance\r
+ Occurrence <= Instance\r
);\r
}\r
//\r
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
//\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