MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / AsciiStrCmp

Function AsciiStrCmp

MdePkg/Library/BaseLib/String.c:1281–1309  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1279
1280**/
1281INTN
1282EFIAPI
1283AsciiStrCmp(
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.

Callers 15

InitializeFrontPageFunction · 0.85
SetVariablesFromNvramFunction · 0.85
patch_nvidia_romFunction · 0.85
init_cardFunction · 0.85
DumpChildSsdtFunction · 0.85
DumpTableFunction · 0.85
isPatchNameMatchFunction · 0.85
PatchKextMethod · 0.85
InitThemeFunction · 0.85
OSInfoOSVendorImplFunction · 0.85
bootElToritoFunction · 0.85
FindChildFunction · 0.85

Calls 1

AsciiStrSizeFunction · 0.85

Tested by

no test coverage detected