summaryrefslogtreecommitdiffstats
path: root/qtools
diff options
context:
space:
mode:
Diffstat (limited to 'qtools')
-rw-r--r--qtools/qcstring.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qtools/qcstring.cpp b/qtools/qcstring.cpp
index 1eb24aa..fdd9971 100644
--- a/qtools/qcstring.cpp
+++ b/qtools/qcstring.cpp
@@ -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;
}