KTV fix for bug 2818
authorktv
Tue, 06 Jul 2010 03:44:46 +0530
changeset 159 004508c4f714
parent 158 ffa983aa9d7f
child 162 d15654dbe9b8
KTV fix for bug 2818
engine/src/PodcastUtils.cpp
--- a/engine/src/PodcastUtils.cpp	Mon Jul 05 22:18:13 2010 +0100
+++ b/engine/src/PodcastUtils.cpp	Tue Jul 06 03:44:46 2010 +0530
@@ -204,18 +204,21 @@
 		
 	CleanupStack::PopAndDestroy(tmpBuf);
 	
-	// chop away newlines at start
-	while (str[0] == KLineBreak) {
-		str = str.Mid(1);
-	}
+	if(str.Length()>1)
+		{
+		// chop away newlines at start
+		while ((str[0] == KLineBreak) )  {
+			str = str.Mid(1);
+		}
+		
+		// chop away newlines at end
 	
-	// chop away newlines at end
+		while ((str[str.Length()-1] == KLineBreak)) {
+			str = str.Left(str.Length()-1);
+		}
 
-	while (str[str.Length()-1] == KLineBreak) {
-		str = str.Left(str.Length()-1);
-	}
-
-	str.Trim();
+		str.Trim();
+		}
 }
 
 EXPORT_C void PodcastUtils::RemoveAllFormatting(TDes & aString)