KTV fix for bug 2818 symbian1
authorktv
Tue, 06 Jul 2010 03:44:46 +0530
branchsymbian1
changeset 161 ce4f70a6d1d2
parent 160 6477d22a5dca
child 164 000f9fc147b2
KTV fix for bug 2818
engine/src/PodcastUtils.cpp
--- a/engine/src/PodcastUtils.cpp	Tue Jul 06 10:34:42 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)