aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarlson2k <k2k@narod.ru>2013-10-28 21:43:13 +0400
committerKarlson2k <k2k@narod.ru>2013-10-28 21:45:09 +0400
commit04aa88bb37be94b0fcdb3ee27ecb4be3fbd02232 (patch)
tree9c85d63ad1e1ad147196fecea012e79dc628a568
parente0ad223a3e0c078aa02366b2cee8420a7d670f43 (diff)
RssReader::Process: fix: read unknown length files correctly
-rw-r--r--xbmc/utils/RssReader.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/xbmc/utils/RssReader.cpp b/xbmc/utils/RssReader.cpp
index 2bae9be6e0..b12f1efa58 100644
--- a/xbmc/utils/RssReader.cpp
+++ b/xbmc/utils/RssReader.cpp
@@ -36,6 +36,7 @@
#include "utils/TimeUtils.h"
#include "threads/SingleLock.h"
#include "log.h"
+#include "utils/FileUtils.h"
#define RSS_COLOR_BODY 0
#define RSS_COLOR_HEADLINE 1
@@ -161,14 +162,12 @@ void CRssReader::Process()
if (url.GetProtocol() != "http" && url.GetProtocol() != "https")
{
- CFile file;
- if (file.Open(strUrl))
+ void* bufferPtr;
+ const unsigned int fsize = CFileUtils::LoadFile(strUrl, bufferPtr);
+ if (fsize != 0)
{
- char *yo = new char[(int)file.GetLength() + 1];
- file.Read(yo, file.GetLength());
- yo[file.GetLength()] = '\0';
- strXML = yo;
- delete[] yo;
+ strXML.assign((const char*)bufferPtr, fsize);
+ free(bufferPtr);
break;
}
}