diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-11-15 23:24:58 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-11-15 23:26:58 (GMT) |
commit | 9b7e4ffb6c5f7534e4ba11d5798b4eb74d4a2a70 (patch) | |
tree | cde604068dbe270c51a6790189c30594e0d78b70 /src/filename.cpp | |
parent | e986e0039de21791bd1fbb1f59b13f58c4a46324 (diff) | |
download | Doxygen-9b7e4ffb6c5f7534e4ba11d5798b4eb74d4a2a70.zip Doxygen-9b7e4ffb6c5f7534e4ba11d5798b4eb74d4a2a70.tar.gz Doxygen-9b7e4ffb6c5f7534e4ba11d5798b4eb74d4a2a70.tar.bz2 |
Fixed several Coverity warnings
Diffstat (limited to 'src/filename.cpp')
-rw-r--r-- | src/filename.cpp | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/filename.cpp b/src/filename.cpp index 35a1841..8719f3c 100644 --- a/src/filename.cpp +++ b/src/filename.cpp @@ -45,9 +45,12 @@ void FileName::generateDiskNames() { // skip references for (it.toFirst();(fd=it.current()) && fd->isReference();++it) { } - // name if unique, so diskname is simply the name - //printf("!!!!!!!! Unique disk name=%s for fd=%s\n",name.data(),fd->diskname.data()); - fd->m_diskName=name; + if (fd) + { + // name if unique, so diskname is simply the name + //printf("!!!!!!!! Unique disk name=%s for fd=%s\n",name.data(),fd->diskname.data()); + fd->m_diskName=name; + } } else if (count>1) // multiple occurrences of the same file name { @@ -57,28 +60,31 @@ void FileName::generateDiskNames() while (!found) // search for the common prefix of all paths { for (it.toFirst();(fd=it.current()) && fd->isReference();++it) { } - char c=fd->m_path.at(i); - if (c=='/') j=i; // remember last position of dirname - ++it; - while ((fd=it.current()) && !found) + if (fd) { - if (!fd->isReference()) + char c=fd->m_path.at(i); + if (c=='/') j=i; // remember last position of dirname + ++it; + while ((fd=it.current()) && !found) { - //printf("i=%d j=%d fd->path=`%s' fd->name=`%s'\n",i,j,fd->path.left(i).data(),fd->name().data()); - if (i==(int)fd->m_path.length()) + if (!fd->isReference()) { - //warning("Input file %s found multiple times!\n" - // " The generated documentation for this file may not be correct!\n",fd->absFilePath().data()); - found=TRUE; - } - else if (fd->m_path[i]!=c) - { - found=TRUE; + //printf("i=%d j=%d fd->path=`%s' fd->name=`%s'\n",i,j,fd->path.left(i).data(),fd->name().data()); + if (i==(int)fd->m_path.length()) + { + //warning("Input file %s found multiple times!\n" + // " The generated documentation for this file may not be correct!\n",fd->absFilePath().data()); + found=TRUE; + } + else if (fd->m_path[i]!=c) + { + found=TRUE; + } } + ++it; } - ++it; + i++; } - i++; } for (it.toFirst();(fd=it.current());++it) { |