//\r
if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH)) {\r
LengthToReturn += ((Width - Precision) * BytesPerOutputCharacter);\r
- if ((Flags & COUNT_ONLY_NO_PRINT) == 0) {\r
+ if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {\r
Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);\r
}\r
}\r
if (ZeroPad) {\r
if (Prefix != 0) {\r
LengthToReturn += (1 * BytesPerOutputCharacter);\r
- if ((Flags & COUNT_ONLY_NO_PRINT) == 0) {\r
+ if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {\r
Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);\r
}\r
}\r
LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);\r
- if ((Flags & COUNT_ONLY_NO_PRINT) == 0) {\r
+ if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {\r
Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, '0', BytesPerOutputCharacter);\r
}\r
} else {\r
LengthToReturn += ((Precision - Count) * BytesPerOutputCharacter);\r
- if ((Flags & COUNT_ONLY_NO_PRINT) == 0) {\r
+ if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {\r
Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Precision - Count, ' ', BytesPerOutputCharacter);\r
}\r
if (Prefix != 0) {\r
LengthToReturn += (1 * BytesPerOutputCharacter);\r
- if ((Flags & COUNT_ONLY_NO_PRINT) == 0) {\r
+ if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {\r
Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, Prefix, BytesPerOutputCharacter);\r
}\r
}\r
ArgumentCharacter = ((*ArgumentString & 0xff) | (*(ArgumentString + 1) << 8)) & ArgumentMask;\r
\r
LengthToReturn += (1 * BytesPerOutputCharacter);\r
- if ((Flags & COUNT_ONLY_NO_PRINT) == 0) {\r
+ if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {\r
Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ArgumentCharacter, BytesPerOutputCharacter);\r
}\r
ArgumentString += BytesPerArgumentCharacter;\r
Index++;\r
if (Index < Count) {\r
LengthToReturn += (1 * BytesPerOutputCharacter);\r
- if ((Flags & COUNT_ONLY_NO_PRINT) == 0) {\r
+ if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {\r
Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, 1, ',', BytesPerOutputCharacter);\r
}\r
}\r
//\r
if ((Flags & (PAD_TO_WIDTH | LEFT_JUSTIFY)) == (PAD_TO_WIDTH | LEFT_JUSTIFY)) {\r
LengthToReturn += ((Width - Precision) * BytesPerOutputCharacter);\r
- if ((Flags & COUNT_ONLY_NO_PRINT) == 0) {\r
+ if ((Flags & COUNT_ONLY_NO_PRINT) == 0 && Buffer != NULL) {\r
Buffer = BasePrintLibFillBuffer (Buffer, EndBuffer, Width - Precision, ' ', BytesPerOutputCharacter);\r
}\r
}\r
return (LengthToReturn / BytesPerOutputCharacter);\r
}\r
\r
+ ASSERT (Buffer != NULL);\r
//\r
// Null terminate the Unicode or ASCII string\r
//\r