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

Function AsciiStrnSizeS

MdePkg/Library/BaseLib/SafeString.c:1767–1790  ·  view source on GitHub ↗

Returns the size of a Null-terminated Ascii string in bytes, including the Null terminator. This function returns the size of the Null-terminated Ascii string specified by String in bytes, including the Null terminator. @param String A pointer to a Null-terminated Ascii string. @param MaxSize The maximum number of Destination Ascii char, including the Nu

Source from the content-addressed store, hash-verified

1765
1766**/
1767UINTN
1768EFIAPI
1769AsciiStrnSizeS (
1770 IN CONST CHAR8 *String,
1771 IN UINTN MaxSize
1772 )
1773{
1774 //
1775 // If String is a null pointer, then the AsciiStrnSizeS function returns
1776 // zero.
1777 //
1778 if (String == NULL) {
1779 return 0;
1780 }
1781
1782 //
1783 // Otherwise, the AsciiStrnSizeS function returns the size of the
1784 // Null-terminated Ascii string in bytes, including the Null terminator. If
1785 // there is no Null terminator in the first MaxSize characters of String,
1786 // then AsciiStrnSizeS returns (sizeof (CHAR8) * (MaxSize + 1)) to keep a
1787 // consistent map with the AsciiStrnLenS function.
1788 //
1789 return (AsciiStrnLenS (String, MaxSize) + 1);
1790}
1791
1792/**
1793 Copies the string pointed to by Source (including the terminating null char)

Callers

nothing calls this directly

Calls 1

AsciiStrnLenSFunction · 0.85

Tested by

no test coverage detected