string overflow bugfix
[org.ibex.util.git] / src / org / ibex / util / Log.java
index 2659b26..2f69732 100644 (file)
@@ -198,7 +198,7 @@ public class Log {
                             String shortened = s.substring(s.indexOf('(')+1);
                             shortened = shortened.substring(0, shortened.indexOf(')'));
                             m += " " + shortened;
-                            if (ok > 1) m = m.substring(0, 78);
+                            if (ok > 1) m = m.substring(0, Math.min(m.length(), 78));
                             ok++;
                         }
                     } while (m.length() < 78);