Compares two Null-terminated ASCII strings, and returns the difference between the first mismatched ASCII characters. This function compares the Null-terminated ASCII string FirstString to the Null-terminated ASCII string SecondString. If FirstString is identical to SecondString, then 0 is returned. Otherwise, the value returned is the first mismatched ASCII character in SecondStr
| 1279 | |
| 1280 | **/ |
| 1281 | INTN |
| 1282 | EFIAPI |
| 1283 | AsciiStrCmp( |
| 1284 | IN CONST CHAR8 *FirstString, |
| 1285 | IN CONST CHAR8 *SecondString |
| 1286 | ) |
| 1287 | { |
| 1288 | // |
| 1289 | // ASSERT both strings are less long than PcdMaximumAsciiStringLength |
| 1290 | // |
| 1291 | // ASSERT (AsciiStrSize (FirstString)); |
| 1292 | // ASSERT (AsciiStrSize (SecondString)); |
| 1293 | if (!AsciiStrSize (FirstString) && !AsciiStrSize (SecondString)) { |
| 1294 | return 0; |
| 1295 | } |
| 1296 | if (!AsciiStrSize (FirstString)) { |
| 1297 | return -1; |
| 1298 | } |
| 1299 | if (!AsciiStrSize (SecondString)) { |
| 1300 | return 1; |
| 1301 | } |
| 1302 | |
| 1303 | while ((*FirstString != '\0') && (*FirstString == *SecondString)) { |
| 1304 | FirstString++; |
| 1305 | SecondString++; |
| 1306 | } |
| 1307 | |
| 1308 | return *FirstString - *SecondString; |
| 1309 | } |
| 1310 | |
| 1311 | /** |
| 1312 | Converts a lowercase Ascii character to upper one. |
no test coverage detected