summaryrefslogtreecommitdiffstats
path: root/qtools
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-11-29 15:53:34 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-11-29 15:53:34 (GMT)
commit84a6f4155659f97d42290494bd21d51f55eda258 (patch)
tree48a1292668d95e18c3639439699b1b566f8bfa67 /qtools
parentdb6cabd07bb4c4b854542570cef96dac48484e0a (diff)
downloadDoxygen-84a6f4155659f97d42290494bd21d51f55eda258.zip
Doxygen-84a6f4155659f97d42290494bd21d51f55eda258.tar.gz
Doxygen-84a6f4155659f97d42290494bd21d51f55eda258.tar.bz2
Use result of vsnprintf
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;
}