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
| 1195 | |
| 1196 | **/ |
| 1197 | UINTN |
| 1198 | EFIAPI |
| 1199 | AsciiStrLen( |
| 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 |
no outgoing calls
no test coverage detected