]> git.siccegge.de Git - frida/frida.git/blobdiff - src/gui/widgets/BasicBlockWidget.cxx
Fix formating of comments. Should not start with a linebreak
[frida/frida.git] / src / gui / widgets / BasicBlockWidget.cxx
index 1cdc33f3dc7eb2ce4cf67f84ba8b1e77a0f24d0d..2a3f3b7d992f30f4f5089754a1016bf221ac13c7 100644 (file)
@@ -261,12 +261,11 @@ void BasicBlockWidget::populateWidget() {
 }
 
 QString BasicBlockWidget::formatComments(Instruction* inst) {
-       QString comments;
+       QStringList comments;
        for (Comment* c: inst->comments()) {
-               comments += "<br />";
-               comments += QString(c->getText().c_str()).toHtmlEscaped();
+               comments << QString(c->getText().c_str()).toHtmlEscaped();
        }
-       return (comments == "" ? "" : ";; ") + comments.trimmed();
+       return (comments.empty() ? "" : ";; ") + comments.join("<br />").trimmed();
 }
 
 void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*,