Fixed a crash when printf() formats are set as 0 (NULL).

git-svn-id: http://picoc.googlecode.com/svn/trunk@576 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2012-08-30 10:18:36 +00:00
parent e4629df5ea
commit a106391d2e

View file

@ -186,12 +186,16 @@ int StdioBasePrintf(struct ParseState *Parser, FILE *Stream, char *StrOut, int S
{
struct Value *ThisArg = Args->Param[0];
int ArgCount = 0;
char *FPos = Format;
char *FPos;
char OneFormatBuf[MAX_FORMAT+1];
int OneFormatCount;
struct ValueType *ShowType;
StdOutStream SOStream;
if (Format == NULL)
Format = "[null format]\n";
FPos = Format;
SOStream.FilePtr = Stream;
SOStream.StrOutPtr = StrOut;
SOStream.StrOutLen = StrOutLen;