beagle r4810 - trunk/beagle/Filters



Author: dbera
Date: Sun Jul  6 19:59:39 2008
New Revision: 4810
URL: http://svn.gnome.org/viewvc/beagle?rev=4810&view=rev

Log:
Catch some string parsing errors while parsing piding log files.


Modified:
   trunk/beagle/Filters/FilterPidginLog.cs

Modified: trunk/beagle/Filters/FilterPidginLog.cs
==============================================================================
--- trunk/beagle/Filters/FilterPidginLog.cs	(original)
+++ trunk/beagle/Filters/FilterPidginLog.cs	Sun Jul  6 19:59:39 2008
@@ -163,7 +163,7 @@
 
 			// If this is true, then the line probably spills
 			// from the previous one
-			if (line [0] != '(' || i == -1) {				
+			if (line [0] != '(' || i == -1 || line.Length <= i + 2) {				
 				return line;
 			}
 
@@ -181,7 +181,7 @@
 			// Also pay attention so that we don't break on aliases that
 			// have a ':' in their name.
 			i = line.IndexOf (": ");
-			if (i == -1 || line.Length < i + 2)
+			if (i == -1 || line.Length <= i + 2)
 				return null;
 			
 			return line.Substring (i + 2);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]