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

Function AsciiStrLen

MdePkg/Library/BaseLib/String.c:1197–1223  ·  view source on GitHub ↗

Returns the length of a Null-terminated ASCII string. This function returns the number of ASCII characters in the Null-terminated ASCII string specified by String. If Length > 0 and Destination is NULL, then ASSERT(). If Length > 0 and Source is NULL, then ASSERT(). If PcdMaximumAsciiStringLength is not zero and String contains more than PcdMaximumAsciiStringLength ASCII char

Source from the content-addressed store, hash-verified

1195
1196**/
1197UINTN
1198EFIAPI
1199AsciiStrLen(
1200 IN CONST CHAR8 *String
1201 )
1202{
1203 UINTN Length;
1204
1205// ASSERT (String != NULL);
1206 if (!String) {
1207 return 0;
1208 }
1209
1210 for (Length = 0; *String != '\0'; String++, Length++) {
1211 //
1212 // If PcdMaximumUnicodeStringLength is not zero,
1213 // length should not more than PcdMaximumUnicodeStringLength
1214 //
1215 // if (PcdGet32 (PcdMaximumAsciiStringLength) != 0) {
1216 // ASSERT (Length < PcdGet32 (PcdMaximumAsciiStringLength));
1217 if (Length == 100000000ull) {
1218 break;
1219 }
1220 // }
1221 }
1222 return Length;
1223}
1224
1225/**
1226 Returns the size of a Null-terminated ASCII string in bytes, including the

Callers 15

String.cFile · 0.85
AsciiStrSizeFunction · 0.85
DebugPrintMarkerFunction · 0.85
DebugAssertFunction · 0.85
DebugPrintMarkerFunction · 0.85
DebugAssertFunction · 0.85
UefiLib.cFile · 0.85
DebugPrintMarkerFunction · 0.85
DebugAssertFunction · 0.85
DevPathToTextAcpiExFunction · 0.85
InternalPrintMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected