Skip to content

Commit

Permalink
Use result of vsnprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed Nov 29, 2014
1 parent db6cabd commit 84a6f41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qtools/qcstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ QCString &QCString::sprintf( const char *format, ... )
int l = length();
if (l<minlen) { resize(minlen); l=minlen; }
int n=vsnprintf( data(), l, format, ap);
resize(qstrlen(data())+1);
if (n<0) n=l;
resize(n+1);
va_end( ap );
return *this;
}
Expand Down

0 comments on commit 84a6f41

Please sign in to comment.