summaryrefslogtreecommitdiffstats
path: root/qtools
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2015-08-18 19:07:17 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2015-08-18 19:07:17 (GMT)
commit48ced3ea8071b3141216482e2821e10250910947 (patch)
tree547a30cd6cc5015b3e85170cd944e14224e7ae9c /qtools
parent625e7a17bc708a32d52158ac24e7308c9d62fe84 (diff)
downloadDoxygen-48ced3ea8071b3141216482e2821e10250910947.zip
Doxygen-48ced3ea8071b3141216482e2821e10250910947.tar.gz
Doxygen-48ced3ea8071b3141216482e2821e10250910947.tar.bz2
Fixed various issues found by PVS-Studio.
Diffstat (limited to 'qtools')
-rw-r--r--qtools/qcstring.h2
-rw-r--r--qtools/qfile_win32.cpp2
-rw-r--r--qtools/qstring.cpp6
3 files changed, 6 insertions, 4 deletions
diff --git a/qtools/qcstring.h b/qtools/qcstring.h
index 4f15b18..abf30b3 100644
--- a/qtools/qcstring.h
+++ b/qtools/qcstring.h
@@ -149,7 +149,7 @@ public:
/** creates a string with room for size characters
* @param[in] size the number of character to allocate (including the 0-terminator)
*/
- QCString( int size ) : m_rep(size)
+ explicit QCString( int size ) : m_rep(size)
{
}
diff --git a/qtools/qfile_win32.cpp b/qtools/qfile_win32.cpp
index 80ad628..a4ab013 100644
--- a/qtools/qfile_win32.cpp
+++ b/qtools/qfile_win32.cpp
@@ -264,7 +264,7 @@ bool QFile::open( int m )
} else {
length = (int)st.st_size;
ioIndex = (flags() & IO_Append) == 0 ? 0 : length;
- if ( (flags() & !IO_Truncate) && length == 0 && isReadable() ) {
+ if ( !(flags()&IO_Truncate) && length == 0 && isReadable() ) {
// try if you can read from it (if you can, it's a sequential
// device; e.g. a file in the /proc filesystem)
int c = getch();
diff --git a/qtools/qstring.cpp b/qtools/qstring.cpp
index 458fd53..d831cb1 100644
--- a/qtools/qstring.cpp
+++ b/qtools/qstring.cpp
@@ -11957,7 +11957,8 @@ QString QString::visual(int index, int len)
QChar* QString::asciiToUnicode( const QByteArray& ba, uint* len )
{
if ( ba.isNull() ) {
- *len = 0;
+ if ( len )
+ *len = 0;
return 0;
}
int l = 0;
@@ -11976,7 +11977,8 @@ QChar* QString::asciiToUnicode( const QByteArray& ba, uint* len )
static QChar* internalAsciiToUnicode( const QByteArray& ba, uint* len )
{
if ( ba.isNull() ) {
- *len = 0;
+ if ( len )
+ *len = 0;
return 0;
}
int l = 0;