Fix off-by-one bug in a line that was even more buggy until a few hours ago.
[quassel.git] / src / qtgui / chatline.cpp
index 5d828c1..5d0a973 100644 (file)
@@ -223,6 +223,7 @@ int ChatLine::posToCursor(QPointF pos) {
       return line.start;
     }
   }
+  return 0;
 }
 
 void ChatLine::precomputeLine() {
@@ -243,7 +244,7 @@ void ChatLine::precomputeLine() {
     for(int j = url.start; j < url.end; j++) charUrlIdx[j] = i;
   }
   if(!textFormat.count()) return;
-  int idx = 0; int cnt = 0; int w = 0; int h = 0;
+  int idx = 0; int cnt = 0; int w = 0;
   QFontMetrics metrics(textFormat[0].format.font());
   Word wr;
   wr.start = -1; wr.trailing = -1;