summaryrefslogtreecommitdiffstats
path: root/qtools/qstring.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2004-12-13 18:59:17 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2004-12-13 18:59:17 (GMT)
commitd048df9811a8686d93dc28f275a1c5c575833669 (patch)
tree024124085a492939d5ad3d3b60fbac43f928b925 /qtools/qstring.cpp
parent71de527ef4ec4b221eecfe02450548390fc03cf4 (diff)
downloadDoxygen-d048df9811a8686d93dc28f275a1c5c575833669.zip
Doxygen-d048df9811a8686d93dc28f275a1c5c575833669.tar.gz
Doxygen-d048df9811a8686d93dc28f275a1c5c575833669.tar.bz2
Release-1.3.9.1-20041213
Diffstat (limited to 'qtools/qstring.cpp')
-rw-r--r--qtools/qstring.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/qtools/qstring.cpp b/qtools/qstring.cpp
index 4707fed..e073168 100644
--- a/qtools/qstring.cpp
+++ b/qtools/qstring.cpp
@@ -15156,16 +15156,18 @@ QCString qt_winQString2MB( const QString& s, int uclen )
if ( uclen == 0 )
return QCString();
BOOL used_def;
- QCString mb(4096);
+ int bufSize=4096;
+ QCString mb(bufSize);
int len;
while ( !(len=WideCharToMultiByte(CP_ACP, 0, (const WCHAR*)s.unicode(), uclen,
- mb.data(), mb.size()-1, 0, &used_def)) )
+ mb.data(), bufSize-1, 0, &used_def)) )
{
int r = GetLastError();
if ( r == ERROR_INSUFFICIENT_BUFFER ) {
- mb.resize(1+WideCharToMultiByte( CP_ACP, 0,
- (const WCHAR*)s.unicode(), uclen,
- 0, 0, 0, &used_def));
+ bufSize=1+WideCharToMultiByte( CP_ACP, 0,
+ (const WCHAR*)s.unicode(), uclen,
+ 0, 0, 0, &used_def);
+ mb.resize(bufSize);
// and try again...
} else {
// Fail.