Skip to content

Commit

Permalink
Fix RPMLint msg: Returns random data in a function
Browse files Browse the repository at this point in the history
In mudlet::getMudletPath, I chose to return an empty string,
and in TTextEdit:getSelectedText, I returned whatever happens to
have been added to the buffer before hitting the end of the loop.

Also, Q_UNREACHABLE has been added to throw errors if needed.
  • Loading branch information
kurumushi authored and SlySven committed Jan 15, 2018
1 parent acef791 commit 94b2d83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/TTextEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,8 @@ QString TTextEdit::getSelectedText(char newlineChar)
// we never append the last character of a buffer line se we set our own
text.append(newlineChar);
}
qDebug() << "TTextEdit::getSelectedText(...) INFO - unexpectedly hit bottom of method so returning:" << text;
return text;
}

void TTextEdit::mouseReleaseEvent(QMouseEvent* event)
Expand Down
2 changes: 2 additions & 0 deletions src/mudlet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3402,6 +3402,8 @@ QString mudlet::getMudletPath(const mudletPathType mode, const QString& extra1,
// when saving/resyncing packages/modules - ends in a '/'
return QStringLiteral("%1/.config/mudlet/moduleBackups/").arg(QDir::homePath());
}
Q_UNREACHABLE();
return QString();
}

#if defined(INCLUDE_UPDATER)
Expand Down

0 comments on commit 94b2d83

Please sign in to comment.