From a1ce8b58c4096103d2693313017164772930499e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 11 Dec 2017 18:01:56 +0100 Subject: [PATCH] Simply formats/xml/rxml.c --- libretro-common/formats/xml/rxml.c | 5 +---- libretro-common/streams/file_stream.c | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libretro-common/formats/xml/rxml.c b/libretro-common/formats/xml/rxml.c index 59e3e5a793..0f0b072a70 100644 --- a/libretro-common/formats/xml/rxml.c +++ b/libretro-common/formats/xml/rxml.c @@ -429,10 +429,7 @@ rxml_document_t *rxml_load_document(const char *path) if (!doc) goto error; - filestream_seek(file, 0, SEEK_END); - len = filestream_tell(file); - filestream_rewind(file); - + len = filestream_get_size(file); memory_buffer = (char*)malloc(len + 1); if (!memory_buffer) goto error; diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index 224fea7a5a..c34fcae506 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -249,6 +249,7 @@ RFILE *filestream_open(const char *path, unsigned mode, unsigned hints) if (stream->fd == -1) goto error; + #ifdef HAVE_MMAP if (stream->hints & RETRO_VFS_FILE_ACCESS_HINT_MEMORY_MAP) {