Commit 0ec56b7a authored by Dimitri van Heesch's avatar Dimitri van Heesch

Fixed bug in new QCString::sprintf for long string.

parent d13908f6
...@@ -29,8 +29,9 @@ QCString &QCString::sprintf( const char *format, ... ) ...@@ -29,8 +29,9 @@ QCString &QCString::sprintf( const char *format, ... )
va_list ap; va_list ap;
va_start( ap, format ); va_start( ap, format );
const int minlen=256; const int minlen=256;
if (length()<minlen) resize(minlen); int l = length();
vsnprintf( data(), minlen, format, ap); if (l<minlen) { resize(minlen); l=minlen; }
int n=vsnprintf( data(), l, format, ap);
resize(qstrlen(data())+1); resize(qstrlen(data())+1);
va_end( ap ); va_end( ap );
return *this; return *this;
......
...@@ -1337,7 +1337,7 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path, ...@@ -1337,7 +1337,7 @@ void ClassDiagram::writeFigure(FTextStream &output,const char *path,
QCString epstopdfArgs(4096); QCString epstopdfArgs(4096);
epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
epsBaseName.data(),epsBaseName.data()); epsBaseName.data(),epsBaseName.data());
//printf("Converting eps using `%s'\n",epstopdfCmd.data()); //printf("Converting eps using `%s'\n",epstopdfArgs.data());
portable_sysTimerStart(); portable_sysTimerStart();
if (portable_system("epstopdf",epstopdfArgs)!=0) if (portable_system("epstopdf",epstopdfArgs)!=0)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment