From 51316839084c3292a8fb216e73ed146683028d4a Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 25 Apr 2021 21:25:21 +0200 Subject: [PATCH] Fix issue with test 055 on Cygwin - stored value was overwritten probably due to compiler optimisation bug --- src/markdown.cpp | 4 +--- src/qcstring.h | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/markdown.cpp b/src/markdown.cpp index 8426c363fd2..4627e7371fe 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -265,9 +265,7 @@ static void convertStringFragment(QCString &result,const char *data,int size) { TRACE(result); if (size<0) size=0; - result.resize(size+1); - memcpy(result.rawData(),data,size); - result.at(size)='\0'; + result = QCString(data,(uint)size); } /** helper function to convert presence of left and/or right alignment markers diff --git a/src/qcstring.h b/src/qcstring.h index d53d48d18e9..1adb4bc05ee 100644 --- a/src/qcstring.h +++ b/src/qcstring.h @@ -132,8 +132,6 @@ class QCString /** creates a string from \a str and copies over the first \a maxlen characters. */ QCString( const char *str, uint maxlen ) : m_rep(str?str:"") { m_rep.resize(maxlen); } - /** replaces the contents by that of string \a s. */ - /** replaces the contents by that of C string \a str. */ QCString &operator=( const char *str) { m_rep = str?str:""; return *this; }