+ if ((Flags & COUNT_ONLY_NO_PRINT) != 0) {\r
+ return (LengthToReturn / BytesPerOutputCharacter);\r
+ }\r
+\r
+ ASSERT (Buffer != NULL);\r
+ //\r
+ // Null terminate the Unicode or ASCII string\r
+ //\r
+ InternalPrintLibFillBuffer (Buffer, EndBuffer + BytesPerOutputCharacter, 1, 0, BytesPerOutputCharacter);\r
+ //\r
+ // Make sure output buffer cannot contain more than PcdMaximumUnicodeStringLength\r
+ // Unicode characters if PcdMaximumUnicodeStringLength is not zero. \r
+ //\r
+ ASSERT ((((Flags & OUTPUT_UNICODE) == 0)) || (StrSize ((CHAR16 *) OriginalBuffer) != 0));\r
+ //\r
+ // Make sure output buffer cannot contain more than PcdMaximumAsciiStringLength\r
+ // ASCII characters if PcdMaximumAsciiStringLength is not zero. \r
+ //\r
+ ASSERT ((((Flags & OUTPUT_UNICODE) != 0)) || (AsciiStrSize (OriginalBuffer) != 0));\r
+\r
+ return ((Buffer - OriginalBuffer) / BytesPerOutputCharacter);\r